From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@sunsite.dk
Subject: Re: Test Failures from latest CVS
Date: Sun, 5 Sep 2004 11:12:08 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.61.0409051107380.5838@toltec.zanshin.com> (raw)
In-Reply-To: <20040905173628.A29CB8634@pwstephenson.fsnet.co.uk>
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;
next prev parent reply other threads:[~2004-09-05 18:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-04 1:29 Vin Shelton
2004-09-04 15:11 ` Bart Schaefer
2004-09-04 16:38 ` Bart Schaefer
2004-09-05 17:36 ` Peter Stephenson
2004-09-05 18:12 ` Bart Schaefer [this message]
-- strict thread matches above, loose matches on Subject: below --
2001-04-03 4:46 Test Failures from Latest CVS Vin Shelton
2001-04-03 11:22 ` Sven Wischnowsky
2001-04-04 3:16 ` Vin Shelton
[not found] ` <1010404153344.ZM32462@candle.brasslantern.com>
2001-04-04 21:24 ` Vin Shelton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.61.0409051107380.5838@toltec.zanshin.com \
--to=schaefer@brasslantern.com \
--cc=zsh-workers@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).