From f4c37a78b150005b59801b0a2fdbb36b50a293be Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Fri, 21 Aug 2015 16:55:10 +0100 Subject: 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 --- Src/parse.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Src') 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) -- cgit 1.4.1