From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21723 invoked from network); 5 Sep 2004 18:13:29 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 5 Sep 2004 18:13:29 -0000 Received: (qmail 85733 invoked from network); 5 Sep 2004 18:13:23 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 5 Sep 2004 18:13:23 -0000 Received: (qmail 5990 invoked by alias); 5 Sep 2004 18:13:12 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20320 Received: (qmail 5975 invoked from network); 5 Sep 2004 18:13:11 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 5 Sep 2004 18:13:11 -0000 Received: (qmail 85379 invoked from network); 5 Sep 2004 18:12:12 -0000 Received: from moonbase.zanshin.com (64.84.47.139) by a.mx.sunsite.dk with SMTP; 5 Sep 2004 18:12:09 -0000 Received: from toltec.zanshin.com (toltec.zanshin.com [64.84.47.166]) by moonbase.zanshin.com (8.13.1/8.13.1) with ESMTP id i85IC8wH019146 for ; Sun, 5 Sep 2004 11:12:08 -0700 Date: Sun, 5 Sep 2004 11:12:08 -0700 (PDT) From: Bart Schaefer Reply-To: zsh-workers@sunsite.dk To: zsh-workers@sunsite.dk Subject: Re: Test Failures from latest CVS In-Reply-To: <20040905173628.A29CB8634@pwstephenson.fsnet.co.uk> Message-ID: References: <20040905173628.A29CB8634@pwstephenson.fsnet.co.uk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=-0.0 required=6.0 tests=BAYES_44 autolearn=no version=2.63 X-Spam-Hits: -0.0 On Sun, 5 Sep 2004, Peter Stephenson wrote: > Bart Schaefer wrote: > > (Is there a reason not to assign lastval in that case also? It could > > simplify the code structure.) > > I don't think there's a reason *not* to; it's just not necessary because > in any case on return from bin_eval it gets set to the 1 we just > returned. In that case, and in the interests of reducing entropy, I suggest the following, which I've presented as a context diff rather than unified so you can see the complete final code in the bottom half: Index: Src/builtin.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/builtin.c,v retrieving revision 1.124 diff -c -r1.124 builtin.c *** Src/builtin.c 4 Sep 2004 16:59:35 -0000 1.124 --- Src/builtin.c 5 Sep 2004 18:09:42 -0000 *************** *** 4239,4260 **** scriptname = "(eval)"; prog = parse_string(zjoin(argv, ' ', 1)); ! if (!prog) { ! errflag = 0; ! scriptname = oscriptname; ! ineval = oineval; ! return 1; ! } ! lastval = 0; ! execode(prog, 1, 0); ! ! if (errflag) { ! lastval = errflag; ! errflag = 0; } scriptname = oscriptname; ineval = oineval; --- 4239,4257 ---- scriptname = "(eval)"; prog = parse_string(zjoin(argv, ' ', 1)); ! if (prog) { ! lastval = 0; ! execode(prog, 1, 0); ! if (errflag) ! lastval = errflag; ! } else { ! lastval = 1; } + + errflag = 0; scriptname = oscriptname; ineval = oineval;