Commit a0051993 authored by Nick Wellnhofer's avatar Nick Wellnhofer
Browse files

Fix comparison with root node in xmlXPathCmpNodes

This change has already been made in xmlXPathCmpNodesExt but not in
xmlXPathCmpNodes.
parent 31696020
......@@ -3342,13 +3342,13 @@ xmlXPathCmpNodes(xmlNodePtr node1, xmlNodePtr node2) {
* compute depth to root
*/
for (depth2 = 0, cur = node2;cur->parent != NULL;cur = cur->parent) {
if (cur == node1)
if (cur->parent == node1)
return(1);
depth2++;
}
root = cur;
for (depth1 = 0, cur = node1;cur->parent != NULL;cur = cur->parent) {
if (cur == node2)
if (cur->parent == node2)
return(-1);
depth1++;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment