From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29959 invoked from network); 3 Jun 2000 16:00:31 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 3 Jun 2000 16:00:31 -0000 Received: (qmail 26761 invoked by alias); 3 Jun 2000 16:00:18 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11736 Received: (qmail 26752 invoked from network); 3 Jun 2000 16:00:17 -0000 From: "Bart Schaefer" Message-Id: <1000603155946.ZM16766@candle.brasslantern.com> Date: Sat, 3 Jun 2000 15:59:46 +0000 In-Reply-To: <20000603152904.A948@eggink3.rrz.uni-hamburg.de> Comments: In reply to Bernd Eggink "Bug: TRAPEXIT not executed" (Jun 3, 3:29pm) References: <20000603152904.A948@eggink3.rrz.uni-hamburg.de> X-Mailer: Z-Mail (5.0.0 30July97) To: Bernd Eggink , Zsh Workers Subject: Re: Bug: TRAPEXIT not executed MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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