1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-01-22 00:21:27 +01:00

24611: fix ${+array[...]} for empty range

This commit is contained in:
Peter Stephenson 2008-02-27 15:51:26 +00:00
parent 4ff6e11df2
commit 0076d68664
3 changed files with 15 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2008-02-27 Peter Stephenson <pws@csr.com>
* 24611: Src/subst.c, Test/D04parameter.ztst: 23562
broke the case of ${+array[...]} for an empty range match.
2008-02-26 Peter Stephenson <p.w.stephenson@ntlworld.com>
* 24602: Test/C02cond.ztst: failing to run a test didn't

View file

@ -1915,7 +1915,8 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int ssub)
hkeys|hvals|
(arrasg ? SCANPM_ASSIGNING : 0)|
(qt ? SCANPM_DQUOTED : 0))) ||
(v->pm && (v->pm->node.flags & PM_UNSET)))
(v->pm && (v->pm->node.flags & PM_UNSET)) ||
(v->flags & VALFLAG_EMPTY))
vunset = 1;
if (wantt) {

View file

@ -52,6 +52,14 @@
0:$+...
>1 1 0 0
x=()
print ${+x} ${+x[1]} ${+x[(r)foo]} ${+x[(r)bar]}
x=(foo)
print ${+x} ${+x[1]} ${+x[(r)foo]} ${+x[(r)bar]}
0:$+... with arrays
>1 0 0 0
>1 1 1 0
set1=set1v
null1=
print ${set1:-set1d} ${set1-set2d} ${null1:-null1d} ${null1-null2d} x