1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-03 10:21:46 +02:00

35326: $#- was misparsed as ${#-}

This commit is contained in:
Peter Stephenson 2015-05-29 16:06:47 +01:00
parent d9243734e1
commit e88610b786
3 changed files with 11 additions and 3 deletions

View file

@ -1,7 +1,10 @@
2015-05-29 Peter Stephenson <p.stephenson@samsung.com>
* 20237: Src/Modules/parameter.c: $functions[foo] shouldn't be
unmetafied when passed as parameter body.
* 35326: Src/subst.c, Test/D04parameter.ztst: $#- was misparsed
as ${#-}.
* users/20237: Src/Modules/parameter.c: $functions[foo]
shouldn't be unmetafied when passed as parameter body.
2015-05-28 Daniel Hahler <zsh@thequod.de>

View file

@ -2170,7 +2170,7 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags)
*/
|| ((cc == '#' || cc == Pound) &&
s[2] == Outbrace)
|| cc == '-' || (cc == ':' && s[2] == '-')
|| (inbrace && (cc == '-' || (cc == ':' && s[2] == '-')))
|| (isstring(cc) && (s[2] == Inbrace || s[2] == Inpar)))) {
getlen = 1 + whichlen, s++;
/*

View file

@ -1703,3 +1703,8 @@
funnychars='The qu*nk br!wan f@x j/mps o[]r \(e la~# ^"&;'
[[ $funnychars = ${~${(b)funnychars}} ]]
0:${(b)...} quoting protects from GLOB_SUBST
set --
print $#-1
0:Avoid confusion after overloaded characters in braceless substitution
>0-1