fixed xmlXPathCmpNodes for incorrect result on certain cases when
* xpath.c: fixed xmlXPathCmpNodes for incorrect result on certain
cases when comparing identical nodes (bug 415567) with patch
from Oleg Paraschenko
svn path=/trunk/; revision=3587
diff --git a/ChangeLog b/ChangeLog
index e218333..da01ca2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Wed Mar 7 16:18:18 HKT 2007 William Brack <wbrack@mmm.com.hk>
+
+ * xpath.c: fixed xmlXPathCmpNodes for incorrect result on certain
+ cases when comparing identical nodes (bug #415567) with patch
+ from Oleg Paraschenko
+
Fri Feb 16 09:13:38 PST 2007 William Brack <wbrack@mmm.com.hk>
* python/libxml.py: fixed tab problem with patch from
diff --git a/xpath.c b/xpath.c
index aa573a6..8c35e30 100644
--- a/xpath.c
+++ b/xpath.c
@@ -198,6 +198,7 @@
XML_NAMESPACE_DECL,
XML_XML_NAMESPACE,
BAD_CAST "xml",
+ NULL,
NULL
};
static xmlNsPtr xmlXPathXMLNamespace = &xmlXPathXMLNamespaceStruct;
@@ -2840,6 +2841,8 @@
/*
* a couple of optimizations which will avoid computations in most cases
*/
+ if (node1 == node2) /* trivial case */
+ return(0);
if (node1->type == XML_ATTRIBUTE_NODE) {
attr1 = 1;
attrNode1 = node1;