fixed xpath single letter predicate bug (eg a[0])

This commit is contained in:
Olof hagsand 2017-02-12 16:36:04 +01:00
parent 4461cc9598
commit c3af59b2d8

View file

@ -199,7 +199,7 @@ xpath_parse_predicate(struct xpath_element *xe,
int len; int len;
len = strlen(pred); len = strlen(pred);
for (i=len-2; i>=0; i--){ /* -2 since we search for ][ */ for (i=len-1; i>=0; i--){ /* -2 since we search for ][ */
s = &pred[i]; s = &pred[i];
if (i==0 || if (i==0 ||
(*(s)==']' && *(s+1)=='[')){ (*(s)==']' && *(s+1)=='[')){