summaryrefslogtreecommitdiff
path: root/pattern.c
diff options
context:
space:
mode:
Diffstat (limited to 'pattern.c')
-rw-r--r--pattern.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/pattern.c b/pattern.c
index ee51968..0e38c2d 100644
--- a/pattern.c
+++ b/pattern.c
@@ -2285,9 +2285,13 @@ xmlStreamPop(xmlStreamCtxtPtr stream) {
if (stream->blockLevel == stream->level)
stream->blockLevel = -1;
- stream->level--;
- if (stream->level < 0)
- return(-1);
+ /*
+ * stream->level can be zero when XML_FINAL_IS_ANY_NODE is set
+ * (see the thread at
+ * http://mail.gnome.org/archives/xslt/2008-July/msg00027.html)
+ */
+ if (stream->level)
+ stream->level--;
/*
* Check evolution of existing states
*/