From 97c74dcb0e5a22d57759c15d64eaeab87ba410f1 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 12 Dec 2017 09:13:41 +0000 Subject: 42110: Fix redirections between variable assignments at start of line --- ChangeLog | 5 +++++ Src/parse.c | 4 ++++ Test/A04redirect.ztst | 7 +++++++ 3 files changed, 16 insertions(+) diff --git a/ChangeLog b/ChangeLog index b99d5e11e..16fcd3f61 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2017-12-12 Peter Stephenson + + * 42110: Src/parse.c, Test/A04redirect.ztst: fix redirection in + between variable assignments at start of line. + 2017-12-01 Peter Stephenson * dana: 42065: Test/B10getopts.ztst: new getopts tests. diff --git a/Src/parse.c b/Src/parse.c index 5fe3ebd2c..6af2550df 100644 --- a/Src/parse.c +++ b/Src/parse.c @@ -1848,6 +1848,10 @@ par_simple(int *cmplx, int nr) incmdpos = oldcmdpos; isnull = 0; assignments = 1; + } else if (IS_REDIROP(tok)) { + *cmplx = c = 1; + nr += par_redir(&r, NULL); + continue; } else break; zshlex(); diff --git a/Test/A04redirect.ztst b/Test/A04redirect.ztst index cb82751ce..b8105cf6d 100644 --- a/Test/A04redirect.ztst +++ b/Test/A04redirect.ztst @@ -622,3 +622,10 @@ >FOO >HERE >} + + a=b 2>/dev/null c=d + print $a + print $c +0:Redirect in the middle of assignments +>b +>d -- cgit 1.4.1