diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2011-06-03 22:03:43 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2011-06-03 22:03:43 +0000 |
commit | 22af58bf2b5b695cdbfaf4b7cdf82bb09136860b (patch) | |
tree | f30446b7473ab48abd4a4488d0284e68965a9e7d /Src | |
parent | 16324d2ff347e96e43dd95780ff014d2183faf8d (diff) | |
download | zsh-22af58bf2b5b695cdbfaf4b7cdf82bb09136860b.tar.gz zsh-22af58bf2b5b695cdbfaf4b7cdf82bb09136860b.tar.xz zsh-22af58bf2b5b695cdbfaf4b7cdf82bb09136860b.zip |
29451: ${##stuff} removes stuff from the head of $#
Diffstat (limited to 'Src')
-rw-r--r-- | Src/subst.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Src/subst.c b/Src/subst.c index f9c48404b..314489e49 100644 --- a/Src/subst.c +++ b/Src/subst.c @@ -2080,7 +2080,16 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int ssub) || (cc = s[1]) == '*' || cc == Star || cc == '@' || cc == '?' || cc == Quest || cc == '$' || cc == String || cc == Qstring - || cc == '#' || cc == Pound + /* + * Me And My Squiggle: + * ${##} is the length of $#, but ${##foo} + * is $# with a "foo" removed from the start. + * If someone had defined the *@!@! language + * properly in the first place we wouldn't + * have this nonsense. + */ + || ((cc == '#' || cc == Pound) && + s[2] == Outbrace) || cc == '-' || (cc == ':' && s[2] == '-') || (isstring(cc) && (s[2] == Inbrace || s[2] == Inpar)))) { getlen = 1 + whichlen, s++; |