1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-27 16:50:58 +01:00

39035: ${(A)name=word} should expand as an array even when there is only one element.

This commit is contained in:
Barton E. Schaefer 2016-08-12 16:10:26 -07:00
parent 04003e038a
commit a1a58dde6a
3 changed files with 11 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2016-08-12 Barton E. Schaefer <schaefer@zsh.org>
* 39035: Src/subst.c, Test/D04parameter.ztst: ${(A)name=word}
should expand as an array even when there is only one element.
2016-08-12 Peter Stephenson <p.stephenson@samsung.com>
* 39031: Src/Zle/zle_word.c: Ensure variables are initialised in

View file

@ -2897,6 +2897,7 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags,
aval = paramvalarr(pm->gsu.h->getfn(pm), hkeys|hvals);
} else
setaparam(idbeg, a);
isarr = 1;
} else {
untokenize(val);
setsparam(idbeg, ztrdup(val));

View file

@ -82,6 +82,11 @@
>wasnull2d
>wasnull2d
unset array
print ${#${(A)=array=word}}
0:${#${(A)=array=word}} counts array elements
>1
(print ${set1:?okhere}; print ${unset1:?exiting1}; print not reached;)
(print ${null1?okhere}; print ${null1:?exiting2}; print not reached;)
1:${...:?...}, ${...?...}