diff options
author | William M. Brack <wbrack@src.gnome.org> | 2007-06-06 17:19:24 +0000 |
---|---|---|
committer | William M. Brack <wbrack@src.gnome.org> | 2007-06-06 17:19:24 +0000 |
commit | 97ac819cc650e5241303baa65b0fd04d112fd9e1 (patch) | |
tree | 5d2f3fb10da6e4eba7f992066576504ac7c61470 /xpath.c | |
parent | d611c88a010fa7c64c407155e43b04bc4c7e9e38 (diff) | |
download | libxml2-97ac819cc650e5241303baa65b0fd04d112fd9e1.tar.gz |
fixed problem with xmlXPathNodeSetSort; fixed problem with
* xpath.c: fixed problem with xmlXPathNodeSetSort;
fixed problem with xmlXPathNodeTrailingSorted (both bug#413451)
svn path=/trunk/; revision=3622
Diffstat (limited to 'xpath.c')
-rw-r--r-- | xpath.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -3194,6 +3194,11 @@ xmlXPathCmpNodesExt(xmlNodePtr node1, xmlNodePtr node2) { turtle_comparison: + if (miscNode1 != NULL) + node1 = miscNode1; + if (miscNode2 != NULL) + node2 = miscNode2; + if (node1 == node2->prev) return(1); if (node1 == node2->next) @@ -4612,12 +4617,13 @@ xmlXPathNodeTrailingSorted (xmlNodeSetPtr nodes, xmlNodePtr node) { return(ret); l = xmlXPathNodeSetGetLength(nodes); - for (i = l; i > 0; i--) { + for (i = l - 1; i >= 0; i--) { cur = xmlXPathNodeSetItem(nodes, i); if (cur == node) break; xmlXPathNodeSetAddUnique(ret, cur); } + xmlXPathNodeSetSort(ret); /* bug 413451 */ return(ret); } |