1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-11-19 13:33:52 +01:00

fix for reverse subscripting of strings as second part of subscript ($a[x,(r)..]) (13907)

This commit is contained in:
Sven Wischnowsky 2001-04-05 11:24:16 +00:00
parent 163b0101ed
commit ee553c9ec0
2 changed files with 9 additions and 2 deletions

@ -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,

@ -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;