mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-24 13:33:01 +03:00
Fix order of root nodes
Make sure root nodes are sorted before other nodes.
This commit is contained in:
4
xpath.c
4
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++;
|
||||
|
||||
Reference in New Issue
Block a user