about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2017-03-04 15:25:17 -0800
committerBarton E. Schaefer <schaefer@zsh.org>2017-03-04 15:25:17 -0800
commit5e61eaf855dc4bc94c35e9e950fb2e1d7f88d5af (patch)
tree8e3121f2430565b2a00d7a48e616f1c29c6e680c
parentb8b5f18f3fcfe64e4b7596018d31410042f379f1 (diff)
downloadzsh-5e61eaf855dc4bc94c35e9e950fb2e1d7f88d5af.tar.gz
zsh-5e61eaf855dc4bc94c35e9e950fb2e1d7f88d5af.tar.xz
zsh-5e61eaf855dc4bc94c35e9e950fb2e1d7f88d5af.zip
40654: exit cleanly from special POSIXBUILTINS in subshells
This patch overloads the zsh_subshell counter which is meant for $ZSH_SUBSHELL, but no one has suggested a working alternate test.
-rw-r--r--ChangeLog5
-rw-r--r--Src/exec.c1
2 files changed, 6 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index df23602c0..ecbae823e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-03-04  Barton E. Schaefer  <schaefer@zsh.org>
+
+	* 40654: Src/exec.c: exit cleanly from special POSIXBUILTINS in
+	subshells
+
 2017-03-04  Oliver Kiddle  <opk@zsh.org>
 
 	* unposted (github): Christoffer Aasted:
diff --git a/Src/exec.c b/Src/exec.c
index 83d1513d0..6af4ddbf3 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -3996,6 +3996,7 @@ execcmd_exec(Estate state, Execcmd_params eparams,
 	 * classify as a builtin) we treat all errors as fatal.
 	 * The "command" builtin is not special so resets this behaviour.
 	 */
+	forked |= zsh_subshell;
     fatal:
 	if (redir_err || errflag) {
 	    if (!isset(INTERACTIVE)) {