1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-18 15:21:16 +02:00

Fix "${=foo=$@}".

This commit is contained in:
Bart Schaefer 2001-02-16 17:16:13 +00:00
parent d9b00a3870
commit af2ae90d25
2 changed files with 9 additions and 5 deletions

View file

@ -1,9 +1,13 @@
2001-02-16 Bart Schaefer <schaefer@zsh.org>
* 13495: Follow-up to 13492 to un-break "${(A)=foo=$@}".
2001-02-16 Sven Wischnowsky <wischnow@zsh.org> 2001-02-16 Sven Wischnowsky <wischnow@zsh.org>
* 13494: Completion/Core/compinit: make `compdef foo=bar' use the * 13494: Completion/Core/compinit: make `compdef foo=bar' use the
service defined for `bar' if there is any service defined for `bar' if there is any
2001-02-16 Bart Schaefer <schaefer@brasslantern.com> 2001-02-16 Bart Schaefer <schaefer@zsh.org>
* 13492: Src/subst.c: Partial fix for ${1+"$@"} expanding to * 13492: Src/subst.c: Partial fix for ${1+"$@"} expanding to
an array (still doesn't handle shwordsplit properly); fix so an array (still doesn't handle shwordsplit properly); fix so

View file

@ -1015,7 +1015,7 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int ssub)
spbreak = 0; spbreak = 0;
s++; s++;
} else } else
spbreak = 1; spbreak = 2;
} else if ((c == '#' || c == Pound) && } else if ((c == '#' || c == Pound) &&
(iident(cc = s[1]) (iident(cc = s[1])
|| cc == '*' || cc == Star || cc == '@' || cc == '*' || cc == Star || cc == '@'
@ -1414,8 +1414,6 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int ssub)
if (spsep || spbreak) { if (spsep || spbreak) {
aval = sepsplit(val, spsep, 0, 1); aval = sepsplit(val, spsep, 0, 1);
isarr = 2; isarr = 2;
sep = spsep = NULL;
spbreak = 0;
l = arrlen(aval); l = arrlen(aval);
if (l && !*(aval[l-1])) if (l && !*(aval[l-1]))
l--; l--;
@ -1456,10 +1454,12 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int ssub)
if (isarr) { if (isarr) {
if (nojoin) if (nojoin)
isarr = -1; isarr = -1;
if (qt && !getlen && isarr > 0) { if (qt && !getlen && isarr > 0 && !spsep && spbreak < 2) {
val = sepjoin(aval, sep, 1); val = sepjoin(aval, sep, 1);
isarr = 0; isarr = 0;
} }
sep = spsep = NULL;
spbreak = 0;
} }
} }
break; break;