fixed bug 126976 (string != empty nodeset should be false)
* xpath.c: fixed bug 126976 (string != empty nodeset
should be false)
diff --git a/xpath.c b/xpath.c
index 1284100..fd97498 100644
--- a/xpath.c
+++ b/xpath.c
@@ -4359,14 +4359,13 @@
((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE)))
return (0);
ns = arg->nodesetval;
- hash = xmlXPathStringHash(str);
- if (ns == NULL)
+ /*
+ * A NULL nodeset compared with a string is always false
+ * (since there is no node equal, and no node not equal)
+ */
+ if ((ns == NULL) || (ns->nodeNr <= 0) )
return (0);
- if (ns->nodeNr <= 0) {
- if (hash == 0)
- return(neq ^ 1);
- return(neq);
- }
+ hash = xmlXPathStringHash(str);
for (i = 0; i < ns->nodeNr; i++) {
if (xmlXPathNodeValHash(ns->nodeTab[i]) == hash) {
str2 = xmlNodeGetContent(ns->nodeTab[i]);