about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2015-08-21 16:55:10 +0100
committerPeter Stephenson <pws@zsh.org>2015-08-21 16:55:10 +0100
commitf4c37a78b150005b59801b0a2fdbb36b50a293be (patch)
tree1adefe6b9a35852e38878979d6a66be698a6e851 /Src
parentc0df3440a44ac74a09115b536019b8ca6076245f (diff)
downloadzsh-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')
-rw-r--r--Src/parse.c5
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)