about summary refs log tree commit diff
path: root/Src/exec.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2016-09-29 17:29:58 +0100
committerPeter Stephenson <pws@zsh.org>2016-09-29 17:29:58 +0100
commit6ce696f35236dc4c1b6249c6f1e7f64cc95a6046 (patch)
tree32d563a9982cf4ffbd658d1156199b4084293858 /Src/exec.c
parent99f74d6c0ac76910e45435dc69a3441415721a01 (diff)
downloadzsh-6ce696f35236dc4c1b6249c6f1e7f64cc95a6046.tar.gz
zsh-6ce696f35236dc4c1b6249c6f1e7f64cc95a6046.tar.xz
zsh-6ce696f35236dc4c1b6249c6f1e7f64cc95a6046.zip
39502: Fork for assignment in LHS of pipeline.
  foo=bar | stuff

left the value of foo set to bar as we didn't realise we needed to
fork.
Diffstat (limited to 'Src/exec.c')
-rw-r--r--Src/exec.c3
1 files changed, 2 insertions, 1 deletions
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;