diff options
| author | Peter Stephenson <pws@zsh.org> | 2015-02-16 12:37:38 +0000 |
|---|---|---|
| committer | Peter Stephenson <pws@zsh.org> | 2015-02-16 12:37:38 +0000 |
| commit | 8ebe18c081a0bd2f134f5fcbf1650d5d59920c96 (patch) | |
| tree | ad956694f15df0fcfe91c1c0d197664b7ae45ff0 /Src/exec.c | |
| parent | 34551: Avoid adding an extra "/" to the target path in cd_try_chdir() when th... (diff) | |
| download | zsh-8ebe18c081a0bd2f134f5fcbf1650d5d59920c96.tar zsh-8ebe18c081a0bd2f134f5fcbf1650d5d59920c96.tar.gz zsh-8ebe18c081a0bd2f134f5fcbf1650d5d59920c96.tar.bz2 zsh-8ebe18c081a0bd2f134f5fcbf1650d5d59920c96.tar.lz zsh-8ebe18c081a0bd2f134f5fcbf1650d5d59920c96.tar.xz zsh-8ebe18c081a0bd2f134f5fcbf1650d5d59920c96.tar.zst zsh-8ebe18c081a0bd2f134f5fcbf1650d5d59920c96.zip | |
34530: PRINT_EXIT_VALUE with anonymous functions.
Simpler fix, avoiding structural changes.
Diffstat (limited to 'Src/exec.c')
| -rw-r--r-- | Src/exec.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/Src/exec.c b/Src/exec.c index de6b9c574..947b815f9 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -3364,9 +3364,9 @@ execcmd(Estate state, int input, int output, int how, int last1) zcontext_restore(); } else redir_prog = NULL; - + lastval = execfuncdef(state, redir_prog); - } + } else if (type >= WC_CURSH) { if (last1 == 1) do_exec = 1; @@ -4495,6 +4495,16 @@ execfuncdef(Estate state, Eprog redir_prog) execshfunc(shf, args); ret = lastval; + if (isset(PRINTEXITVALUE) && isset(SHINSTDIN) && + lastval) { +#if defined(ZLONG_IS_LONG_LONG) && defined(PRINTF_HAS_LLD) + fprintf(stderr, "zsh: exit %lld\n", lastval); +#else + fprintf(stderr, "zsh: exit %ld\n", (long)lastval); +#endif + fflush(stderr); + } + freeeprog(shf->funcdef); if (shf->redir) /* shouldn't be */ freeeprog(shf->redir); |
