diff options
| author | Barton E. Schaefer <schaefer@zsh.org> | 2016-08-12 16:10:26 -0700 |
|---|---|---|
| committer | Barton E. Schaefer <schaefer@zsh.org> | 2016-08-12 16:10:26 -0700 |
| commit | a1a58dde6adaa50625016f4c7048b456b2b99a1c (patch) | |
| tree | b54d4de680e05be6feabb863fcc3bd5f2cb12599 | |
| parent | 39031: Ensure variables in transpose-words are initialised (diff) | |
| download | zsh-a1a58dde6adaa50625016f4c7048b456b2b99a1c.tar zsh-a1a58dde6adaa50625016f4c7048b456b2b99a1c.tar.gz zsh-a1a58dde6adaa50625016f4c7048b456b2b99a1c.tar.bz2 zsh-a1a58dde6adaa50625016f4c7048b456b2b99a1c.tar.lz zsh-a1a58dde6adaa50625016f4c7048b456b2b99a1c.tar.xz zsh-a1a58dde6adaa50625016f4c7048b456b2b99a1c.tar.zst zsh-a1a58dde6adaa50625016f4c7048b456b2b99a1c.zip | |
39035: ${(A)name=word} should expand as an array even when there is only one element.
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | Src/subst.c | 1 | ||||
| -rw-r--r-- | Test/D04parameter.ztst | 5 |
3 files changed, 11 insertions, 0 deletions
@@ -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 diff --git a/Src/subst.c b/Src/subst.c index 99e1650d0..c61551bf6 100644 --- a/Src/subst.c +++ b/Src/subst.c @@ -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)); diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst index 460a841c3..37166fa21 100644 --- a/Test/D04parameter.ztst +++ b/Test/D04parameter.ztst @@ -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:${...:?...}, ${...?...} |
