Changeset 13332 in project


Ignore:
Timestamp:
02/17/09 20:07:21 (11 years ago)
Author:
sjamaan
Message:

Fix small issue which would cause node-pos to crash if given an out-of-bounds negative index (it should return the empty list, as it does if you pass in out-of-bounds positive indices). Same here, reported upstream but no response yet. This is probably not the fastest implementation, so we will want to revisit later

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/sxml-tools/sxml-tools/sxpathlib.scm

    r13275 r13332  
    206206     ((null? nodelist) nodelist)
    207207     ((eqv? n 1) (list (car nodelist)))
    208      ((negative? n) ((node-pos (+ n 1 (length nodelist))) nodelist))
     208     ((negative? n) ((node-pos (- n)) (reverse nodelist)))
    209209     (else
    210210      (assert (positive? n))
Note: See TracChangeset for help on using the changeset viewer.