[Expat-checkins] expat/lib expat.h,1.46,1.47 xmlparse.c,1.97,1.98

Karl Waclawek kwaclaw at users.sourceforge.net
Sun Dec 15 20:02:07 EST 2002


Update of /cvsroot/expat/expat/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv28769

Modified Files:
	expat.h xmlparse.c 
Log Message:
Fix for bug/feature request #653180.

Index: expat.h
===================================================================
RCS file: /cvsroot/expat/expat/lib/expat.h,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- expat.h	27 Nov 2002 03:31:23 -0000	1.46
+++ expat.h	16 Dec 2002 04:02:00 -0000	1.47
@@ -809,13 +809,15 @@
 XML_GetErrorCode(XML_Parser parser);
 
 /* These functions return information about the current parse
-   location.  They may be called when XML_Parse or XML_ParseBuffer
-   return 0; in this case the location is the location of the
-   character at which the error was detected.
-
-   They may also be called from any other callback called to report
-   some parse event; in this the location is the location of the first
-   of the sequence of characters that generated the event.
+   location.  They may be called from any callback called to report
+   some parse event; in this case the location is the location of
+   the first of the sequence of characters that generated the event. 
+   
+   They may also be called after returning from a call to XML_Parse
+   or XML_ParseBuffer.  If the return value is XML_STATUS_ERROR then
+   the location is the location of the character at which the error
+   was detected; otherwise the location is the location of the last
+   parse event, as described above.
 */
 XMLPARSEAPI(int) XML_GetCurrentLineNumber(XML_Parser parser);
 XMLPARSEAPI(int) XML_GetCurrentColumnNumber(XML_Parser parser);

Index: xmlparse.c
===================================================================
RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -d -r1.97 -r1.98
--- xmlparse.c	27 Nov 2002 17:11:32 -0000	1.97
+++ xmlparse.c	16 Dec 2002 04:02:02 -0000	1.98
@@ -1393,6 +1393,7 @@
       return XML_STATUS_ERROR;
     }
     XmlUpdatePosition(encoding, positionPtr, end, &position);
+    positionPtr = end;
     nLeftOver = s + len - end;
     if (nLeftOver) {
       if (buffer == NULL || nLeftOver > bufferLim - buffer) {
@@ -1442,8 +1443,10 @@
   errorCode = processor(parser, start, parseEndPtr = bufferEnd,
                         isFinal ? (const char **)NULL : &bufferPtr);
   if (errorCode == XML_ERROR_NONE) {
-    if (!isFinal)
+    if (!isFinal) {
       XmlUpdatePosition(encoding, positionPtr, bufferPtr, &position);
+      positionPtr = bufferPtr;
+    }
     return XML_STATUS_OK;
   }
   else {





More information about the Expat-checkins mailing list