25791: force return from eval-style DEBUG trap lost status

This commit is contained in:
Peter Stephenson 2008-10-01 11:34:48 +00:00
parent 06cf28875e
commit 57418f3c7d
3 changed files with 19 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2008-10-01 Peter Stephenson <pws@csr.com>
* 25791: Src/exec.c, Test/C05debug.ztst: force return from
eval-style DEBUG trap lost status.
2008-09-30 Peter Stephenson <pws@csr.com>
* Frank Terbeck: 25778: Functions/VCS_Info/VCS_INFO_realpath: use

View file

@ -1091,7 +1091,8 @@ execlist(Estate state, int dont_change_job, int exiting)
exiting = donetrap;
ret = lastval;
dotrap(SIGDEBUG);
lastval = ret;
if (!retflag)
lastval = ret;
donetrap = exiting;
noerrexit = oldnoerrexit;
/*
@ -1230,7 +1231,8 @@ sublist_done:
exiting = donetrap;
ret = lastval;
dotrap(SIGDEBUG);
lastval = ret;
if (!retflag)
lastval = ret;
donetrap = exiting;
noerrexit = oldnoerrexit;
opts[ERREXIT] = oerrexit_opt;

View file

@ -137,3 +137,13 @@
>9: 'fn2'
>0: 'echo wow'
>wow
foo() {
emulate -L zsh; setopt debugbeforecmd
trap '[[ $ZSH_DEBUG_CMD == *bar* ]] && return 2' DEBUG
echo foo
echo bar
}
foo
2:Status of forced return from eval-style DEBUG trap
>foo