int XMLCALL
XML_GetCurrentLineNumber(XML_Parser parser)
{
- if (eventPtr) {
+ if (eventPtr && eventPtr >= positionPtr) {
XmlUpdatePosition(encoding, positionPtr, eventPtr, &position);
positionPtr = eventPtr;
}
int XMLCALL
XML_GetCurrentColumnNumber(XML_Parser parser)
{
- if (eventPtr) {
+ if (eventPtr && eventPtr >= positionPtr) {
XmlUpdatePosition(encoding, positionPtr, eventPtr, &position);
positionPtr = eventPtr;
}
const char *end,
const char **endPtr)
{
+ int tok;
const char *next = start; /* XmlContentTok doesn't always set the last arg */
- int tok = XmlContentTok(encoding, start, end, &next);
+ eventPtr = start;
+ tok = XmlContentTok(encoding, start, end, &next);
+ eventEndPtr = next;
+
switch (tok) {
case XML_TOK_XML_DECL:
{
*endPtr = start;
return XML_ERROR_NONE;
}
- eventPtr = start;
return XML_ERROR_UNCLOSED_TOKEN;
case XML_TOK_PARTIAL_CHAR:
if (!finalBuffer) {
*endPtr = start;
return XML_ERROR_NONE;
}
- eventPtr = start;
return XML_ERROR_PARTIAL_CHAR;
}
processor = externalEntityContentProcessor;
const char *end,
const char **nextPtr)
{
- const char *start = s;
- const char *next = s;
int tok;
+ const char *start = s;
+ const char *next = start;
+ eventPtr = start;
for (;;) {
tok = XmlPrologTok(encoding, start, end, &next);
+ eventEndPtr = next;
if (tok <= 0) {
if (!finalBuffer && tok != XML_TOK_INVALID) {
*nextPtr = s;
return XML_ERROR_NONE;
}
start = next;
+ eventPtr = start;
}
}
/* report partial linebreak - it might be the last token */
case -XML_TOK_PROLOG_S:
if (defaultHandler) {
- eventEndPtr = next;
reportDefault(parser, encoding, s, next);
if (parsing == XML_FINISHED)
return XML_ERROR_ABORTED;