about summary refs log tree commit diff
path: root/Src/exec.c
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-08-14 16:34:52 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-08-14 16:34:52 +0000
commitedf58408576053fbe1592f807fc4b28ee5ed4366 (patch)
tree0cf1d543ee5f51764e30efe10055cf2caed3016b /Src/exec.c
parent5de60daa2aff45bd1e9cdc7abd1f464b2c35be8e (diff)
downloadzsh-edf58408576053fbe1592f807fc4b28ee5ed4366.tar.gz
zsh-edf58408576053fbe1592f807fc4b28ee5ed4366.tar.xz
zsh-edf58408576053fbe1592f807fc4b28ee5ed4366.zip
manual/7436
Diffstat (limited to 'Src/exec.c')
-rw-r--r--Src/exec.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Src/exec.c b/Src/exec.c
index eab846540..a7a861f12 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -1522,7 +1522,7 @@ execcmd(Cmd cmd, int input, int output, int how, int last1)
 
 	    /* Current shell should not fork unless the *
 	     * exec occurs at the end of a pipeline.    */
-	    if ((cflags & BINF_EXEC) && last1 == 2)
+	    if ((cflags & BINF_EXEC) && last1)
 		flags |= CFLAG_EXEC;
 
 	    /* Empty command */
@@ -2053,8 +2053,9 @@ execcmd(Cmd cmd, int input, int output, int how, int last1)
 	    restore_params(restorelist, removelist);
 
 	} else {
-	    if (flags & CFLAG_EXEC) {
+	    if (!forked)
 		setiparam("SHLVL", --shlvl);
+	    if (flags & CFLAG_EXEC) {
 		/* If we are exec'ing a command, and we are not *
 		 * in a subshell, then save the history file.   */
 		if (!subsh && isset(RCS) && interact && !nohistsave)