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:
parent
4ff6e11df2
commit
0076d68664
3 changed files with 15 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue