[libxml2] Fix comparison with root node in xmlXPathCmpNodes
- From: Nick Wellnhofer <nwellnhof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libxml2] Fix comparison with root node in xmlXPathCmpNodes
- Date: Wed, 12 Oct 2016 11:29:20 +0000 (UTC)
commit a005199330b86dada19d162cae15ef9bdcb6baa8
Author: Nick Wellnhofer <wellnhofer aevum de>
Date: Tue Jun 28 14:19:58 2016 +0200
Fix comparison with root node in xmlXPathCmpNodes
This change has already been made in xmlXPathCmpNodesExt but not in
xmlXPathCmpNodes.
xpath.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/xpath.c b/xpath.c
index 751665b..d992841 100644
--- a/xpath.c
+++ b/xpath.c
@@ -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++;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]