From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 139 invoked from network); 5 Aug 2008 08:34:00 -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; 5 Aug 2008 08:34:00 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 20818 invoked from network); 5 Aug 2008 08:33:46 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 5 Aug 2008 08:33:46 -0000 Received: (qmail 4645 invoked by alias); 5 Aug 2008 08:33:32 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25392 Received: (qmail 4627 invoked from network); 5 Aug 2008 08:33:30 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 5 Aug 2008 08:33:30 -0000 Received: from cluster-d.mailcontrol.com (cluster-d.mailcontrol.com [217.69.20.190]) by bifrost.dotsrc.org (Postfix) with ESMTPS id 7E9AA80590E6 for ; Tue, 5 Aug 2008 10:33:27 +0200 (CEST) Received: from cameurexb01.EUROPE.ROOT.PRI ([193.128.72.68]) by rly48d.srv.mailcontrol.com (MailControl) with ESMTP id m758XQ79026367 for ; Tue, 5 Aug 2008 09:33:26 +0100 Received: from news01 ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.3959); Tue, 5 Aug 2008 09:33:26 +0100 Date: Tue, 5 Aug 2008 09:33:26 +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: <20080805093326.2e2915ec@news01> In-Reply-To: <20080804184957.421f87c9@news01> References: <6cd6de210808040308k529da37dh40b8dd1799086420@mail.gmail.com> <20080804184957.421f87c9@news01> 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: 05 Aug 2008 08:33:26.0089 (UTC) FILETIME=[EDF6A390:01C8F6D5] X-Scanned-By: MailControl A-08-50-03 (www.mailcontrol.com) on 10.68.0.158 X-Virus-Scanned: ClamAV 0.92.1/7941/Tue Aug 5 00:44:27 2008 on bifrost X-Virus-Status: Clean Here's a test for the first bug. I didn't find one for the second: it's tied to reading commands line by line from the top-level loop and even running it as a script didn't trigger it for some reason. Index: Test/C03traps.ztst =================================================================== RCS file: /cvsroot/zsh/zsh/Test/C03traps.ztst,v retrieving revision 1.11 diff -u -r1.11 C03traps.ztst --- Test/C03traps.ztst 29 May 2007 14:50:29 -0000 1.11 +++ Test/C03traps.ztst 5 Aug 2008 08:32:02 -0000 @@ -350,6 +350,44 @@ >trap >Working 0 + debug-trap-bug1() { + setopt localtraps + print "print bug file here" >bug-file + print "print this is line one + print this is line two + print this is line three + print and this is line fifty-nine." >bug-file2 + function debug_trap_handler { + print $functrace[1] + do_bug + } + function do_bug { + . ./bug-file + } + trap 'echo EXIT hit' EXIT + trap 'debug_trap_handler' DEBUG + . ./bug-file2 + } + debug-trap-bug1 +0: Relationship between traps and sources +>debug-trap-bug1:15 +>bug file here +>this is line one +>./bug-file2:1 +>bug file here +>this is line two +>./bug-file2:2 +>bug file here +>this is line three +>./bug-file2:3 +>bug file here +>and this is line fifty-nine. +>./bug-file2:4 +>bug file here +>debug-trap-bug1:16 +>bug file here +>EXIT hit + %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