Commit 0b787f37 authored by Daniel Veillard's avatar Daniel Veillard
Browse files

applied patch from Dave Beckett to correct line number errors when using

* parser.c: applied patch from Dave Beckett to correct line number
  errors when using push with CDATA
Daniel
parent b5eb7143
Fri Mar 26 18:28:32 CET 2004 Daniel Veillard <daniel@veillard.com>
* parser.c: applied patch from Dave Beckett to correct line number
errors when using push with CDATA
Fri Mar 26 14:53:58 CET 2004 Daniel Veillard <daniel@veillard.com>
 
* doc/examples/xpath1.c: added a test template
......
......@@ -1260,6 +1260,21 @@ static int spacePop(xmlParserCtxtPtr ctxt) {
xmlPopInput(ctxt); \
} while (0)
#define SKIPL(val) do { \
int skipl; \
for(skipl=0; skipl<val; skipl++) { \
if (*(ctxt->input->cur) == '\n') { \
ctxt->input->line++; ctxt->input->col = 1; \
} else ctxt->input->col++; \
ctxt->nbChars++; \
ctxt->input->cur++; \
} \
if (*ctxt->input->cur == '%') xmlParserHandlePEReference(ctxt); \
if ((*ctxt->input->cur == 0) && \
(xmlParserInputGrow(ctxt->input, INPUT_CHUNK) <= 0)) \
xmlPopInput(ctxt); \
} while (0)
#define SHRINK if ((ctxt->progressive == 0) && \
(ctxt->input->cur - ctxt->input->base > 2 * INPUT_CHUNK) && \
(ctxt->input->end - ctxt->input->cur < 2 * INPUT_CHUNK)) \
......@@ -9250,7 +9265,7 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) {
ctxt->input->cur,
XML_PARSER_BIG_BUFFER_SIZE);
}
SKIP(XML_PARSER_BIG_BUFFER_SIZE);
SKIPL(XML_PARSER_BIG_BUFFER_SIZE);
ctxt->checkIndex = 0;
}
goto done;
......@@ -9264,7 +9279,7 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) {
ctxt->sax->characters(ctxt->userData,
ctxt->input->cur, base);
}
SKIP(base + 3);
SKIPL(base + 3);
ctxt->checkIndex = 0;
ctxt->instate = XML_PARSER_CONTENT;
#ifdef DEBUG_PUSH
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment