about summary refs log tree commit diff
path: root/Src/exec.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2008-09-05 21:02:08 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2008-09-05 21:02:08 +0000
commitdb31a13ecdd8306aad63319ace28bf7d029d4829 (patch)
treee57d6287ae80fb12341a32eae7b8bc0f4d5f2711 /Src/exec.c
parent7ce1d5735832e51bc13e255f2e8549873c9688ff (diff)
downloadzsh-db31a13ecdd8306aad63319ace28bf7d029d4829.tar.gz
zsh-db31a13ecdd8306aad63319ace28bf7d029d4829.tar.xz
zsh-db31a13ecdd8306aad63319ace28bf7d029d4829.zip
25627: add $ZSH_SUBSHELL
Diffstat (limited to 'Src/exec.c')
-rw-r--r--Src/exec.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Src/exec.c b/Src/exec.c
index a147dacd5..e638b9f6e 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -910,6 +910,13 @@ entersubsh(int flags)
     }
     if (!(flags & ESUB_FAKE))
 	subsh = 1;
+    /*
+     * Increment the visible parameter ZSH_SUBSHELL even if this
+     * is a fake subshell because we are exec'ing at the end.
+     * Logically this should be equivalent to a real subshell so
+     * we don't hang out the dirty washing.
+     */
+    zsh_subshell++;
     if ((flags & ESUB_REVERTPGRP) && getpid() == mypgrp)
 	release_pgrp();
     if (SHTTY != -1) {