1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-27 16:50:58 +01:00

* Src/builtin.c, Src/exec.c: Unwind function calls before exiting

shell from exit command to allow EXIT traps to run.
This commit is contained in:
Peter Stephenson 2001-09-24 10:12:51 +00:00
parent cd59ad72b6
commit 11b0734108
3 changed files with 50 additions and 9 deletions

View file

@ -3429,6 +3429,22 @@ doshfunc(char *name, Eprog prog, LinkList doshargs, int flags, int noreturnval)
if (noreturnval)
lastval = oldlastval;
popheap();
if (exit_pending) {
if (locallevel) {
/* Still functions to return: force them to do so. */
retflag = 1;
breaks = loops;
} else {
/*
* All functions finished: time to exit the shell.
* We already did the `stopmsg' test when the
* exit command was handled.
*/
stopmsg = 1;
zexit(exit_pending >> 1, 0);
}
}
}
/* This finally executes a shell function and any function wrappers *