about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-09-01 08:58:25 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-09-01 08:58:25 +0000
commitbc8a27a27753afea075b8ab30229fb99dd01d740 (patch)
treeb69bbb85caa856bca040a2596c5c0e2b192ed803
parent61d274bb7a648fa3ef121f2b762b2a3a1ac97e6c (diff)
downloadzsh-bc8a27a27753afea075b8ab30229fb99dd01d740.tar.gz
zsh-bc8a27a27753afea075b8ab30229fb99dd01d740.tar.xz
zsh-bc8a27a27753afea075b8ab30229fb99dd01d740.zip
manual/7436-for-pws-2
-rw-r--r--Src/exec.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Src/exec.c b/Src/exec.c
index 2fb3b5e9b..27f964430 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -1528,7 +1528,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 */
@@ -2069,8 +2069,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)