diff options
author | Nick Wellnhofer <wellnhofer@aevum.de> | 2015-07-11 14:27:34 +0200 |
---|---|---|
committer | Nick Wellnhofer <wellnhofer@aevum.de> | 2015-07-11 14:27:34 +0200 |
commit | 3eaedba1b64180668fdab7ad2eba549586017bf3 (patch) | |
tree | aa420cd854e42873957ae52f77e1a90b324e29f1 | |
parent | 73b2d73df8981e37a03dfdcf727d8bdafb019266 (diff) | |
download | android_external_libxml2-3eaedba1b64180668fdab7ad2eba549586017bf3.tar.gz android_external_libxml2-3eaedba1b64180668fdab7ad2eba549586017bf3.tar.bz2 android_external_libxml2-3eaedba1b64180668fdab7ad2eba549586017bf3.zip |
Fix previous change to node sort order
Commit ba58f23 broke comparison of nodes from different documents.
Thanks to Olli Pottonen for the report.
-rw-r--r-- | xpath.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -361,14 +361,14 @@ turtle_comparison: /* * compute depth to root */ - for (depth2 = 0, cur = node2; cur != NULL; cur = cur->parent) { - if (cur == node1) + for (depth2 = 0, cur = node2; cur->parent != NULL; cur = cur->parent) { + if (cur->parent == node1) return(1); depth2++; } root = cur; - for (depth1 = 0, cur = node1; cur != NULL; cur = cur->parent) { - if (cur == node2) + for (depth1 = 0, cur = node1; cur->parent != NULL; cur = cur->parent) { + if (cur->parent == node2) return(-1); depth1++; } |