From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11334 invoked from network); 6 Aug 2008 08:51:34 -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; 6 Aug 2008 08:51:34 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 58694 invoked from network); 6 Aug 2008 08:50:53 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 6 Aug 2008 08:50:53 -0000 Received: (qmail 29279 invoked by alias); 6 Aug 2008 08:50:36 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25400 Received: (qmail 29262 invoked from network); 6 Aug 2008 08:50:34 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 6 Aug 2008 08:50:34 -0000 Received: from cluster-g.mailcontrol.com (cluster-g.mailcontrol.com [208.87.233.190]) by bifrost.dotsrc.org (Postfix) with ESMTPS id 03488808A1CD for ; Wed, 6 Aug 2008 10:50:18 +0200 (CEST) Received: from cameurexb01.EUROPE.ROOT.PRI ([193.128.72.68]) by rly06g.srv.mailcontrol.com (MailControl) with ESMTP id m768nTnB029602 for ; Wed, 6 Aug 2008 09:50:10 +0100 Received: from news01 ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.3959); Wed, 6 Aug 2008 09:49:58 +0100 Date: Wed, 6 Aug 2008 09:49:58 +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: <20080806094958.064c04e1@news01> In-Reply-To: <6cd6de210808051625n3ee7156bw468cbbd1418615c3@mail.gmail.com> References: <6cd6de210808040308k529da37dh40b8dd1799086420@mail.gmail.com> <20080804184957.421f87c9@news01> <20080805093326.2e2915ec@news01> <6cd6de210808051625n3ee7156bw468cbbd1418615c3@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: 06 Aug 2008 08:49:58.0984 (UTC) FILETIME=[68302480:01C8F7A1] X-Scanned-By: MailControl A-08-50-03 (www.mailcontrol.com) on 10.71.0.116 X-Virus-Scanned: ClamAV 0.92.1/7955/Wed Aug 6 10:27:30 2008 on bifrost X-Virus-Status: Clean On Tue, 5 Aug 2008 19:25:58 -0400 "Rocky Bernstein" wrote: > I didn't have a problem writing a program that when run gives exit > code 0 if this bug is fixed and exit code 10 if not. > > I tried from checked out sources from a couple days ago when there was > a bug versus currently patched sources. It probably shouldn't be too > hard to work this into the testing system. I'll put it in as is. I think I may have confused myself over the fact that I head the shell in two states: before fixing the first bug, and after fixing the second bug, and this condition didn't turn up. It's worth testing for. The previous test depends on DEBUG_BEFORE_CMD not being set. Index: Test/C03traps.ztst =================================================================== RCS file: /cvsroot/zsh/zsh/Test/C03traps.ztst,v retrieving revision 1.12 diff -u -r1.12 C03traps.ztst --- Test/C03traps.ztst 5 Aug 2008 08:41:24 -0000 1.12 +++ Test/C03traps.ztst 6 Aug 2008 08:48:04 -0000 @@ -350,6 +350,7 @@ >trap >Working 0 + unsetopt DEBUG_BEFORE_CMD debug-trap-bug1() { setopt localtraps print "print bug file here" >bug-file @@ -388,6 +389,19 @@ >bug file here >EXIT hit + cat >zsh-trapreturn-bug2 <<-'HERE' + cmd='./fdasfsdafd' + [[ -x $cmd ]] && rm $cmd + set -o DEBUG_BEFORE_CMD + trap '[[ $? -ne 0 ]] && exit 0' DEBUG + $cmd # invalid command + # Failure + exit 10 + HERE + $ZTST_testdir/../Src/zsh -f ./zsh-trapreturn-bug2 +0: trapreturn handling bug is properly fixed +?./zsh-trapreturn-bug2:5: no such file or directory: ./fdasfsdafd + %clean rm -f TRAPEXIT -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070