about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2015-04-24 16:34:51 +0100
committerPeter Stephenson <pws@zsh.org>2015-04-24 16:34:51 +0100
commite0cdf39fd9cbf056bd95eb08590addf8d40c155b (patch)
tree0e2155ff5def674ebe93ce0206721e28cf4228ad
parentf4d8051de1179a47632b56afdf8659dac689e51f (diff)
downloadzsh-e0cdf39fd9cbf056bd95eb08590addf8d40c155b.tar.gz
zsh-e0cdf39fd9cbf056bd95eb08590addf8d40c155b.tar.xz
zsh-e0cdf39fd9cbf056bd95eb08590addf8d40c155b.zip
34955: save and restore list_pipe_job with its friends
This is needed to stop source() messing up job control.
-rw-r--r--ChangeLog6
-rw-r--r--Src/exec.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 094a35b08..78803b6ae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-04-24  Peter Stephenson  <p.stephenson@samsung.com>
+
+	* 34955: Src/exec.c: list_pipe_job needs saving and restoring
+	with some other similar variables in execlist() in order
+	to stop source() messing up job control.
+
 2015-04-24  Mikael Magnusson  <mikachu@gmail.com>
 
 	* Oliver: 34940: Completion/Zsh/Command/_fc: fix typo breaking
diff --git a/Src/exec.c b/Src/exec.c
index 2a8185cbc..60b79c6ea 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -1146,7 +1146,7 @@ execlist(Estate state, int dont_change_job, int exiting)
     Wordcode next;
     wordcode code;
     int ret, cj, csp, ltype;
-    int old_pline_level, old_list_pipe;
+    int old_pline_level, old_list_pipe, old_list_pipe_job;
     zlong oldlineno;
     /*
      * ERREXIT only forces the shell to exit if the last command in a &&
@@ -1159,10 +1159,11 @@ execlist(Estate state, int dont_change_job, int exiting)
     cj = thisjob;
     old_pline_level = pline_level;
     old_list_pipe = list_pipe;
+    old_list_pipe_job = list_pipe_job;
     oldlineno = lineno;
 
     if (sourcelevel && unset(SHINSTDIN))
-	pline_level = list_pipe = 0;
+	pline_level = list_pipe = list_pipe_job = 0;
 
     /* Loop over all sets of comands separated by newline, *
      * semi-colon or ampersand (`sublists').               */
@@ -1397,6 +1398,7 @@ sublist_done:
     }
     pline_level = old_pline_level;
     list_pipe = old_list_pipe;
+    list_pipe_job = old_list_pipe_job;
     lineno = oldlineno;
     if (dont_change_job)
 	thisjob = cj;