aboutsummaryrefslogtreecommitdiffstats
path: root/xpath.c
diff options
context:
space:
mode:
Diffstat (limited to 'xpath.c')
-rw-r--r--xpath.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xpath.c b/xpath.c
index 5404577d..51899ea3 100644
--- a/xpath.c
+++ b/xpath.c
@@ -2186,7 +2186,7 @@ xmlXPathNodeTrailingSorted (xmlNodeSetPtr nodes, xmlNodePtr node) {
return(ret);
l = xmlXPathNodeSetGetLength(nodes);
- for (i = 0; i < l; i++) {
+ for (i = l; i > 0; i--) {
cur = xmlXPathNodeSetItem(nodes, i);
if (cur == node)
break;