diff options
author | Peter Stephenson <pws@zsh.org> | 2015-08-21 16:55:10 +0100 |
---|---|---|
committer | Peter Stephenson <pws@zsh.org> | 2015-08-21 16:55:10 +0100 |
commit | f4c37a78b150005b59801b0a2fdbb36b50a293be (patch) | |
tree | 1adefe6b9a35852e38878979d6a66be698a6e851 /Src/parse.c | |
parent | c0df3440a44ac74a09115b536019b8ca6076245f (diff) | |
download | zsh-f4c37a78b150005b59801b0a2fdbb36b50a293be.tar.gz zsh-f4c37a78b150005b59801b0a2fdbb36b50a293be.tar.xz zsh-f4c37a78b150005b59801b0a2fdbb36b50a293be.zip |
36265 plus FAQ: fix alias expansion after "function"
Owing to interesting historical parsing, names after the first were treated as command words so had non-global aliases expanded. Add an FAQ note that use of the function keyword works around other alias problems
Diffstat (limited to 'Src/parse.c')
-rw-r--r-- | Src/parse.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Src/parse.c b/Src/parse.c index 1a7416449..09317610b 100644 --- a/Src/parse.c +++ b/Src/parse.c @@ -1600,9 +1600,9 @@ par_funcdef(int *cmplx) p = ecadd(0); ecadd(0); - incmdpos = 1; while (tok == STRING) { - if (*tokstr == Inbrace && !tokstr[1]) { + if ((*tokstr == Inbrace || *tokstr == '{') && + !tokstr[1]) { tok = INBRACE; break; } @@ -1615,6 +1615,7 @@ par_funcdef(int *cmplx) ecadd(0); nocorrect = 0; + incmdpos = 1; if (tok == INOUTPAR) zshlex(); while (tok == SEPER) |