summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2017-05-08 17:19:22 +0100
committerPeter Stephenson <pws@zsh.org>2017-05-08 17:19:22 +0100
commit641a764b8203de5e5f5c9f1d6d5b0a48c26ca9e7 (patch)
tree335e6afa61b9feee5bbb392e3371f269805e8ec2 /Src
parentf25d01a97c61fdac5d6e0a6a8fb63b5b2b5f3393 (diff)
downloadzsh-641a764b8203de5e5f5c9f1d6d5b0a48c26ca9e7.tar.gz
zsh-641a764b8203de5e5f5c9f1d6d5b0a48c26ca9e7.tar.xz
zsh-641a764b8203de5e5f5c9f1d6d5b0a48c26ca9e7.zip
users/22688: Allow mixing redirs and arguments after anon functions.
These are parsed differently from the case of normal functions which
can't take normal arguments at that point.
Diffstat (limited to 'Src')
-rw-r--r--Src/parse.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/Src/parse.c b/Src/parse.c
index 83e87afed..b0de9a863 100644
--- a/Src/parse.c
+++ b/Src/parse.c
@@ -2030,10 +2030,21 @@ par_simple(int *cmplx, int nr)
 		/* Unnamed function */
 		int parg = ecadd(0);
 		ecadd(0);
-		while (tok == STRING) {
-		    ecstr(tokstr);
-		    argc++;
-		    zshlex();
+		while (tok == STRING || IS_REDIROP(tok)) {
+		    if (tok == STRING)
+		    {
+			ecstr(tokstr);
+			argc++;
+			zshlex();
+		    } else {
+			*cmplx = c = 1;
+			nrediradd = par_redir(&r, NULL);
+			p += nrediradd;
+			if (ppost)
+			    ppost += nrediradd;
+			sr += nrediradd;
+			parg += nrediradd;
+		    }
 		}
 		if (argc > 0)
 		    *cmplx = 1;