mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-28 05:00:59 +01:00
21197: Fix LOCAL_TRAPS inside another trap
This commit is contained in:
parent
f49c66fc6a
commit
2c208c7743
3 changed files with 15 additions and 5 deletions
|
|
@ -888,6 +888,10 @@ removetrap(int sig)
|
|||
void
|
||||
starttrapscope(void)
|
||||
{
|
||||
/* No special SIGEXIT behaviour inside another trap. */
|
||||
if (intrap)
|
||||
return;
|
||||
|
||||
/*
|
||||
* SIGEXIT needs to be restored at the current locallevel,
|
||||
* so give it the next higher one. dosavetrap() is called
|
||||
|
|
@ -917,8 +921,11 @@ endtrapscope(void)
|
|||
/*
|
||||
* Remember the exit trap, but don't run it until
|
||||
* after all the other traps have been put back.
|
||||
* Don't do this inside another trap.
|
||||
*/
|
||||
if ((exittr = sigtrapped[SIGEXIT])) {
|
||||
if (intrap)
|
||||
exittr = 0;
|
||||
else if ((exittr = sigtrapped[SIGEXIT])) {
|
||||
if (exittr & ZSIG_FUNC) {
|
||||
exitfn = removehashnode(shfunctab, "TRAPEXIT");
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue