aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2015-03-08 16:44:11 +0100
committerNick Wellnhofer <wellnhofer@aevum.de>2015-03-08 16:44:11 +0100
commitba58f23c60862f2158b457f4d30031761bf4dde1 (patch)
treec615f35a9a5e981daa3b209a0a09c2bcf6267270
parentf6aaabce85baf48d622cb4686df810fdba3db073 (diff)
downloadandroid_external_libxml2-ba58f23c60862f2158b457f4d30031761bf4dde1.tar.gz
android_external_libxml2-ba58f23c60862f2158b457f4d30031761bf4dde1.tar.bz2
android_external_libxml2-ba58f23c60862f2158b457f4d30031761bf4dde1.zip
Fix order of root nodes
Make sure root nodes are sorted before other nodes.
-rw-r--r--xpath.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xpath.c b/xpath.c
index ffd2a489..e9f5bf92 100644
--- a/xpath.c
+++ b/xpath.c
@@ -361,13 +361,13 @@ turtle_comparison:
/*
* compute depth to root
*/
- for (depth2 = 0, cur = node2;cur->parent != NULL;cur = cur->parent) {
+ for (depth2 = 0, cur = node2; cur != NULL; cur = cur->parent) {
if (cur == node1)
return(1);
depth2++;
}
root = cur;
- for (depth1 = 0, cur = node1;cur->parent != NULL;cur = cur->parent) {
+ for (depth1 = 0, cur = node1; cur != NULL; cur = cur->parent) {
if (cur == node2)
return(-1);
depth1++;