diff options
author | Axel Beckert <abe@deuxchevaux.org> | 2015-05-28 02:27:03 +0200 |
---|---|---|
committer | Axel Beckert <abe@deuxchevaux.org> | 2015-05-28 02:27:03 +0200 |
commit | fd2ef9a80430c1f4f4ae222af228b485c484dd64 (patch) | |
tree | 58e2e652beebfed85a7e0545cf81a24f2c74cf09 /Src/exec.c | |
parent | f14d3594049e553de8d61e5fc1d2fa245410a867 (diff) | |
parent | fd786a5c8abf1942a05ed8c470b06cc0b4aa5174 (diff) | |
download | zsh-fd2ef9a80430c1f4f4ae222af228b485c484dd64.tar.gz zsh-fd2ef9a80430c1f4f4ae222af228b485c484dd64.zip |
Merge branch 'upstream' and tag 'zsh-5.0.7-dev-4' into 'debian'
Diffstat (limited to 'Src/exec.c')
-rw-r--r-- | Src/exec.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Src/exec.c b/Src/exec.c index 6a8b35a36..527d61197 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -5101,7 +5101,15 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) } popheap(); - if (exit_pending) { + /* + * Exit with a tidy up. + * Only leave if we're at the end of the appropriate function --- + * not a nested function. As we usually skip the function body, + * the only likely case where we need that second test is + * when we have an "always" block. The endparamscope() has + * already happened, hence the "+1" here. + */ + if (exit_pending && exit_level >= locallevel+1) { if (locallevel > forklevel) { /* Still functions to return: force them to do so. */ retflag = 1; |