From 57418f3c7d72bda89fe5819882ed6d0a42c3a1b6 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Wed, 1 Oct 2008 11:34:48 +0000 Subject: 25791: force return from eval-style DEBUG trap lost status --- ChangeLog | 5 +++++ Src/exec.c | 6 ++++-- Test/C05debug.ztst | 10 ++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index fbec84dbb..e278af632 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-10-01 Peter Stephenson + + * 25791: Src/exec.c, Test/C05debug.ztst: force return from + eval-style DEBUG trap lost status. + 2008-09-30 Peter Stephenson * Frank Terbeck: 25778: Functions/VCS_Info/VCS_INFO_realpath: use diff --git a/Src/exec.c b/Src/exec.c index 1685c799e..5cc92b548 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -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; diff --git a/Test/C05debug.ztst b/Test/C05debug.ztst index 6594eb8a1..b5515c90c 100644 --- a/Test/C05debug.ztst +++ b/Test/C05debug.ztst @@ -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 -- cgit 1.4.1