summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Src/exec.c3
-rw-r--r--Test/A01grammar.ztst7
3 files changed, 12 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 883ff0230..ca9d23b57 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2016-09-29 Peter Stephenson <p.stephenson@samsung.com>
+ * 39502: Src/exec.c, Test/A01grammar.ztst: need to fork for
+ assignment in LHS of pipeline.
+
* unposted: Src/Zle/compctl.c, Src/Zle/zle_tricky.c: update
findcmd() call here, too.
diff --git a/Src/exec.c b/Src/exec.c
index c79a27895..e3915ddfe 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -1844,7 +1844,8 @@ execpline2(Estate state, wordcode pcode,
/* if we are doing "foo | bar" where foo is a current *
* shell command, do foo in a subshell and do the *
* rest of the pipeline in the current shell. */
- if (wc_code(code) >= WC_CURSH && (how & Z_SYNC)) {
+ if ((wc_code(code) >= WC_CURSH || wc_code(code) == WC_ASSIGN)
+ && (how & Z_SYNC)) {
int synch[2];
struct timeval bgtime;
diff --git a/Test/A01grammar.ztst b/Test/A01grammar.ztst
index 921ff99a4..0b1085c3e 100644
--- a/Test/A01grammar.ztst
+++ b/Test/A01grammar.ztst
@@ -756,3 +756,10 @@
> print Stuff here
>}
>Stuff here
+
+ x=1
+ x=2 | echo $x
+ echo $x
+0:Assignment-only current shell commands in LHS of pipelin
+>1
+>1