From 641a764b8203de5e5f5c9f1d6d5b0a48c26ca9e7 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 8 May 2017 17:19:22 +0100 Subject: 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. --- Src/parse.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'Src') 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; -- cgit 1.4.1