diff options
author | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2001-04-05 11:24:16 +0000 |
---|---|---|
committer | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2001-04-05 11:24:16 +0000 |
commit | ee553c9ec0e8ee3e0c4b8f05a43342ea7bcaa24e (patch) | |
tree | 3dfa2a97ece69c4a7d1ca0fab2cc8e8568755692 | |
parent | 163b0101ed6d63c735590d561a8026d74d964401 (diff) | |
download | zsh-ee553c9ec0e8ee3e0c4b8f05a43342ea7bcaa24e.tar.gz zsh-ee553c9ec0e8ee3e0c4b8f05a43342ea7bcaa24e.tar.xz zsh-ee553c9ec0e8ee3e0c4b8f05a43342ea7bcaa24e.zip |
fix for reverse subscripting of strings as second part of subscript ($a[x,(r)..]) (13907)
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | Src/params.c | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog index f4de207cd..69c6ea89f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-04-05 Sven Wischnowsky <wischnow@zsh.org> + + * 13907: Src/params.c: fix for reverse subscripting of strings + as second part of subscript ($a[x,(r)..]) + 2001-04-04 Sven Wischnowsky <wischnow@zsh.org> * 13902: Completion/Base/Utility/_arguments, diff --git a/Src/params.c b/Src/params.c index 1d537d03d..215e5a6f3 100644 --- a/Src/params.c +++ b/Src/params.c @@ -1113,6 +1113,8 @@ getarg(char **str, int *inv, Value v, int a2, zlong *w) if (beg < 0) beg += len; if (beg >= 0 && beg < len) { + char *de = d + len; + if (a2) { if (down) { if (!hasbeg) @@ -1128,7 +1130,7 @@ getarg(char **str, int *inv, Value v, int a2, zlong *w) *t = sav; } } else - for (r = beg, t = d + beg; *t; r++, t++) { + for (r = beg, t = d + beg; t <= de; r++, t++) { sav = *t; *t = '\0'; if (pattry(pprog, d) && @@ -1148,7 +1150,7 @@ getarg(char **str, int *inv, Value v, int a2, zlong *w) return r; } } else - for (r = beg + 1, t = d + beg; *t; r++, t++) + for (r = beg + 1, t = d + beg; t <= de; r++, t++) if (pattry(pprog, t) && !--num) return r; |