1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-12 16:58:16 +03:00

more bug fixes for the XPath streaming code. Daniel

* pattern.c: more bug fixes for the XPath streaming code.
Daniel
This commit is contained in:
Daniel Veillard 2005-02-01 16:21:43 +00:00
parent 0a5985283b
commit 9740d1d425
2 changed files with 19 additions and 3 deletions

View File

@ -1,3 +1,7 @@
Tue Feb 1 18:15:52 CET 2005 Daniel Veillard <daniel@veillard.com>
* pattern.c: more bug fixes for the XPath streaming code.
Mon Jan 31 17:59:24 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net>
* xmlschemas.c: Integrated the streaming pattern from the

View File

@ -39,7 +39,7 @@
#ifdef LIBXML_PATTERN_ENABLED
/* #define DEBUG_STREAMING */
#define DEBUG_STREAMING
#define ERROR(a, b, c, d)
#define ERROR5(a, b, c, d, e)
@ -1029,7 +1029,6 @@ xmlDebugStreamCtxt(xmlStreamCtxtPtr ctxt, int match) {
else
printf("\n");
}
printf("\n");
}
}
#endif
@ -1369,9 +1368,11 @@ xmlStreamPush(xmlStreamCtxtPtr stream,
xmlStreamCtxtAddState(stream, step + 1, stream->level + 1);
}
}
#if 0
} else if (!desc) {
/* didn't match, discard */
stream->states[2 * i] = -1;
#endif
}
}
@ -1426,13 +1427,24 @@ xmlStreamPush(xmlStreamCtxtPtr stream,
*/
int
xmlStreamPop(xmlStreamCtxtPtr stream) {
int i, m;
if (stream == NULL)
return(-1);
stream->level--;
if (stream->level < 0)
return(-1);
/* something is certainly needed here */
/*
* Check evolution of existing states
*/
m = stream->nbState;
for (i = 0;i < m;i++) {
if (stream->states[(2 * i)] < 0) break;
/* discard obsoleted states */
if (stream->states[(2 * i) + 1] > stream->level)
stream->states[(2 * i)] = -1;
}
return(0);
}