about summary refs log tree commit diff
path: root/Src/exec.c
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2001-06-25 00:15:04 +0000
committerBart Schaefer <barts@users.sourceforge.net>2001-06-25 00:15:04 +0000
commitf0dd0ced30845735c9d3922a706ff3a508b3c0b6 (patch)
tree7bc8b157d4478d579e65e69b09442ad439e359ca /Src/exec.c
parent2e4a17b32f0298d899dffa8169d6a7b43d7f547b (diff)
downloadzsh-f0dd0ced30845735c9d3922a706ff3a508b3c0b6.tar.gz
zsh-f0dd0ced30845735c9d3922a706ff3a508b3c0b6.tar.xz
zsh-f0dd0ced30845735c9d3922a706ff3a508b3c0b6.zip
PRINT_EXIT_VALUE for shell functions.
Diffstat (limited to 'Src/exec.c')
-rw-r--r--Src/exec.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Src/exec.c b/Src/exec.c
index 16ff92392..625c376b7 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -2288,9 +2288,6 @@ execcmd(Estate state, int input, int output, int how, int last1)
 #ifdef PATH_DEV_FD
 		closem(2);
 #endif
-		if (isset(PRINTEXITVALUE) && isset(SHINSTDIN) && lastval && !subsh) {
-		    fprintf(stderr, "zsh: exit %ld\n", (long)lastval);
-		}
 		fflush(stdout);
 		if (save[1] == -2) {
 		    if (ferror(stdout)) {
@@ -2300,6 +2297,10 @@ execcmd(Estate state, int input, int output, int how, int last1)
 		} else
 		    clearerr(stdout);
 	    }
+	    if (isset(PRINTEXITVALUE) && isset(SHINSTDIN) &&
+		lastval && !subsh) {
+		fprintf(stderr, "zsh: exit %ld\n", (long)lastval);
+	    }
 
 	    if (do_exec) {
 		if (subsh)