mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-01-13 13:17:36 +03:00
Fix previous change to node sort order
Commit ba58f23
broke comparison of nodes from different documents.
Thanks to Olli Pottonen for the report.
This commit is contained in:
parent
73b2d73df8
commit
3eaedba1b6
8
xpath.c
8
xpath.c
@ -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++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user