1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-21 14:53:44 +03:00

fix the patch for unreproductable #343000 but also fix a line/column

* parser.c: fix the patch for unreproductable #343000 but
  also fix a line/column keeping error
* result/errors/attr1.xml.err result/errors/attr2.xml.err
  result/errors/name.xml.err result/errors/name2.xml.err
  result/schemas/anyAttr-processContents-err1_0_0.err
  result/schemas/bug312957_1_0.err: affected lines in error output
  of the regression tests
Daniel
This commit is contained in:
Daniel Veillard
2006-10-15 20:32:53 +00:00
parent b5f1197ce2
commit dcec672439
8 changed files with 28 additions and 8 deletions

View File

@@ -7865,7 +7865,7 @@ xmlParseStartTag2(xmlParserCtxtPtr ctxt, const xmlChar **pref,
const xmlChar **atts = ctxt->atts;
int maxatts = ctxt->maxatts;
int nratts, nbatts, nbdef;
int i, j, nbNs, attval;
int i, j, nbNs, attval, oldline, oldcol;
const xmlChar *base;
unsigned long cur;
int nsNr = ctxt->nsNr;
@@ -7884,6 +7884,8 @@ reparse:
SHRINK;
base = ctxt->input->base;
cur = ctxt->input->cur - ctxt->input->base;
oldline = ctxt->input->line;
oldcol = ctxt->input->col;
nbatts = 0;
nratts = 0;
nbdef = 0;
@@ -7918,6 +7920,12 @@ reparse:
attname = xmlParseAttribute2(ctxt, prefix, localname,
&aprefix, &attvalue, &len, &alloc);
if (ctxt->input->base != base) {
if ((attvalue != NULL) && (alloc != 0))
xmlFree(attvalue);
attvalue = NULL;
goto base_changed;
}
if ((attname != NULL) && (attvalue != NULL)) {
if (len < 0) len = xmlStrlen(attvalue);
if ((attname == ctxt->str_xmlns) && (aprefix == NULL)) {
@@ -8209,6 +8217,8 @@ base_changed:
xmlFree((xmlChar *) atts[i]);
}
ctxt->input->cur = ctxt->input->base + cur;
ctxt->input->line = oldline;
ctxt->input->col = oldcol;
if (ctxt->wellFormed == 1) {
goto reparse;
}