1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-01 21:51:40 +02:00

32001: fix crash on ${:*} and ${:|}

This commit is contained in:
Peter Stephenson 2013-11-17 20:33:57 +00:00
parent 412eb07885
commit bd919f30ae
3 changed files with 22 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2013-11-17 Peter Stephenson <p.w.stephenson@ntlworld.com>
* 32001: Src/subst.: fix crash on empty arrays with array
intersection and disjunction.
2013-11-15 Barton E. Schaefer <schaefer@zsh.org>
* Martin Vaeth: 31988: Doc/Makefile.in, Util/helpfiles: remove

View file

@ -2941,6 +2941,14 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags)
}
}
}
if (vunset) {
if (unset(UNSET)) {
*idend = '\0';
zerr("%s: parameter not set", idbeg);
return NULL;
}
val = dupstring("");
}
} else { /* no ${...=...} or anything, but possible modifiers. */
/*
* Handler ${+...}. TODO: strange, why do we handle this only

View file

@ -1551,3 +1551,12 @@
0:Empty parameter shouldn't cause modifiers to crash the shell
>
>
# This used to cause uncontrolled behaviour, but at best
# you got the wrong output so the check is worth it.
args() { print $#; }
args ${:*}
args ${:|}
0:Intersection and disjunction with empty parameters
>0
>0