Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug: TRAPEXIT not executed
- X-seq: zsh-workers 11736
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- To: Bernd Eggink <eggink@xxxxxxxxxxxxxx>, Zsh Workers <zsh-workers@xxxxxxxxxxxxxx>
- Subject: Re: Bug: TRAPEXIT not executed
- Date: Sat, 3 Jun 2000 15:59:46 +0000
- In-reply-to: <20000603152904.A948@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
- References: <20000603152904.A948@xxxxxxxxxxxxxxxxxxxxxxxxxx>
On Jun 3, 3:29pm, Bernd Eggink wrote:
} Subject: Bug: TRAPEXIT not executed
}
} When the following script exits, TRAPEXIT doesn't get executed:
}
} function TRAPEXIT
} {
} print BYE
} }
}
} function f
} {
} print f
} }
}
} f
Hmm, it works if you put "setopt localtraps" at the top. So the problem
is that the special handling for the EXIT trap, described by the comment
in starttrapscope(), is not happening.
This must have been introduced back in 9267; the following seems to fix.
Index: Src/signals.c
===================================================================
@@ -751,7 +751,7 @@
* one, to aid in removing this one. However, if there's
* already one at the current locallevel we just overwrite it.
*/
- if (isset(LOCALTRAPS) && locallevel &&
+ if ((isset(LOCALTRAPS) || sig == SIGEXIT) && locallevel &&
(!trapped || locallevel > (sigtrapped[sig] >> ZSIG_SHIFT)))
dosavetrap(sig, locallevel);
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
Messages sorted by:
Reverse Date,
Date,
Thread,
Author