about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--Src/exec.c7
2 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index b1121ffe4..ead54661d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2001-06-24  Bart Schaefer  <schaefer@zsh.org>
+
+	* 15057: Src/exec.c: PRINT_EXIT_VALUE for shell functions, too.
+
 2001-06-23  Bart Schaefer  <schaefer@zsh.org>
 
 	* 15056: Src/Zle/zle_tricky.c: Change magic-space to recognize
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)