From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15222 invoked from network); 4 Aug 2008 17:50:44 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 4 Aug 2008 17:50:44 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 62396 invoked from network); 4 Aug 2008 17:50:28 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 4 Aug 2008 17:50:28 -0000 Received: (qmail 4942 invoked by alias); 4 Aug 2008 17:50:10 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25385 Received: (qmail 4916 invoked from network); 4 Aug 2008 17:50:07 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 4 Aug 2008 17:50:07 -0000 Received: from cluster-d.mailcontrol.com (cluster-d.mailcontrol.com [217.69.20.190]) by bifrost.dotsrc.org (Postfix) with ESMTPS id B68D780590E6 for ; Mon, 4 Aug 2008 19:50:01 +0200 (CEST) Received: from cameurexb01.EUROPE.ROOT.PRI ([193.128.72.68]) by rly47d.srv.mailcontrol.com (MailControl) with ESMTP id m74Ho1aw015210 for ; Mon, 4 Aug 2008 18:50:01 +0100 Received: from news01 ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.3959); Mon, 4 Aug 2008 18:49:58 +0100 Date: Mon, 4 Aug 2008 18:49:57 +0100 From: Peter Stephenson To: zsh-workers@sunsite.dk Subject: Re: trap DEBUG + set -o DEBUG_BEFORE_CMD not setting $? nonzero in current CVS Message-ID: <20080804184957.421f87c9@news01> In-Reply-To: <6cd6de210808040308k529da37dh40b8dd1799086420@mail.gmail.com> References: <6cd6de210808040308k529da37dh40b8dd1799086420@mail.gmail.com> Organization: CSR X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.8; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 04 Aug 2008 17:49:58.0160 (UTC) FILETIME=[82C69100:01C8F65A] X-Scanned-By: MailControl A-08-50-03 (www.mailcontrol.com) on 10.68.0.157 X-Virus-Scanned: ClamAV 0.92.1/7936/Mon Aug 4 19:02:06 2008 on bifrost X-Virus-Status: Clean On Mon, 4 Aug 2008 06:08:39 -0400 "Rocky Bernstein" wrote: > The following code doesn't show $? as nonzero inside trap DEBUG using the > CVS source I just downloaded and built. > > However I don't get this problem on the Ubuntu zsh-beta or zsh. > Removing DEBUG_BEFORE_CMD (or I guess having debug run after the > command) does set/show $? properly. > > #!/tmp/zsh/Src/zsh -f > #!/src/external-cvs/zsh/Src/zsh -f > set -o DEBUG_BEFORE_CMD > trap 'print $?' DEBUG > fdasfsdafd # invalid command > : Turns out to be unfinished business with the previous patch: that code I patched needs also to be told when we're not in a trap at all. It was triggering after the trap, resetting the status. I must write tests for both. Index: Src/init.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/init.c,v retrieving revision 1.89 diff -u -r1.89 init.c --- Src/init.c 4 Aug 2008 17:32:20 -0000 1.89 +++ Src/init.c 4 Aug 2008 17:46:26 -0000 @@ -191,7 +191,7 @@ exit(lastval); if (((!interact || sourcelevel) && errflag) || retflag) break; - if (trapreturn >= 0) { + if (intrap && trapreturn >= 0) { lastval = trapreturn; trapreturn = 0; } -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070