From 6fbcf42aa301dca50737c65fb738752328ca3a4c Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Thu, 21 Mar 2002 12:32:59 +0000 Subject: [PATCH] fixing #75619, related to a problem when trying to evaluate condition when * xpath.c: fixing #75619, related to a problem when trying to evaluate condition when the current node set resulting from that sub-step evaluation is empty. Also fixes 2 potential problem with previous-sibling and next-siblings axis. Daniel --- ChangeLog | 7 +++++++ xpath.c | 4 +--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index bd34971b..6fc129b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Thu Mar 21 13:30:06 CET 2002 Daniel Veillard + + * xpath.c: fixing #75619, related to a problem when trying + to evaluate condition when the current node set resulting + from that sub-step evaluation is empty. Also fixes 2 potential + problem with previous-sibling and next-siblings axis. + Thu Mar 21 09:03:59 CET 2002 Daniel Veillard * c14n.c: patch from Mark Vakoc to build C14N if DocBook and diff --git a/xpath.c b/xpath.c index 4f3e11bc..484975c7 100644 --- a/xpath.c +++ b/xpath.c @@ -8406,7 +8406,6 @@ xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt, #endif last = NULL; next = xmlXPathNextFollowingSibling; - mergeNodeSet = xmlXPathNodeSetMergeUnique; break; case AXIS_NAMESPACE: #ifdef DEBUG_STEP @@ -8438,7 +8437,6 @@ xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt, #endif first = NULL; next = xmlXPathNextPrecedingSibling; - mergeNodeSet = xmlXPathNodeSetMergeUnique; break; case AXIS_SELF: #ifdef DEBUG_STEP @@ -8678,7 +8676,7 @@ xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt, /* * If there is some predicate filtering do it now */ - if (op->ch2 != -1) { + if ((op->ch2 != -1) && (list != NULL) && (list->nodeNr > 0)) { xmlXPathObjectPtr obj2; valuePush(ctxt, xmlXPathWrapNodeSet(list));