mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-10 10:21:23 +02:00
25643: keep DEBUG and ZERR traps in subshells
This commit is contained in:
parent
8bb15c1392
commit
fb67cd46ea
3 changed files with 8 additions and 2 deletions
|
@ -1,5 +1,8 @@
|
||||||
2008-09-11 Peter Stephenson <pws@csr.com>
|
2008-09-11 Peter Stephenson <pws@csr.com>
|
||||||
|
|
||||||
|
* 25643: Doc/Zsh/builtins.yo, Src/exec.c: keep DEBUG and ZERR
|
||||||
|
traps in subshells.
|
||||||
|
|
||||||
* 25641: add option (NO_)MULTI_FUNC_DEF to turn off "foo1
|
* 25641: add option (NO_)MULTI_FUNC_DEF to turn off "foo1
|
||||||
foo2...()" function definitions.
|
foo2...()" function definitions.
|
||||||
|
|
||||||
|
|
|
@ -1330,7 +1330,9 @@ If var(sig) is tt(0) or tt(EXIT)
|
||||||
and the tt(trap) statement is not executed inside the body of a function,
|
and the tt(trap) statement is not executed inside the body of a function,
|
||||||
then the command var(arg) is executed when the shell terminates.
|
then the command var(arg) is executed when the shell terminates.
|
||||||
|
|
||||||
tt(ZERR), tt(DEBUG), and tt(EXIT) traps are not executed inside other traps.
|
tt(ZERR), tt(DEBUG), and tt(EXIT) traps are not executed inside other
|
||||||
|
traps. tt(ZERR) and tt(DEBUG) traps are kept within subshells, while
|
||||||
|
other traps are reset.
|
||||||
|
|
||||||
Note that traps defined with the tt(trap) builtin are slightly different
|
Note that traps defined with the tt(trap) builtin are slightly different
|
||||||
from those defined as `tt(TRAP)var(NAL) () { ... }', as the latter have
|
from those defined as `tt(TRAP)var(NAL) () { ... }', as the latter have
|
||||||
|
|
|
@ -869,7 +869,8 @@ entersubsh(int flags)
|
||||||
|
|
||||||
if (!(flags & ESUB_KEEPTRAP))
|
if (!(flags & ESUB_KEEPTRAP))
|
||||||
for (sig = 0; sig < VSIGCOUNT; sig++)
|
for (sig = 0; sig < VSIGCOUNT; sig++)
|
||||||
if (!(sigtrapped[sig] & ZSIG_FUNC))
|
if (!(sigtrapped[sig] & ZSIG_FUNC) &&
|
||||||
|
sig != SIGDEBUG && sig != SIGZERR)
|
||||||
unsettrap(sig);
|
unsettrap(sig);
|
||||||
monitor = isset(MONITOR);
|
monitor = isset(MONITOR);
|
||||||
if (flags & ESUB_NOMONITOR)
|
if (flags & ESUB_NOMONITOR)
|
||||||
|
|
Loading…
Reference in a new issue