zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@sunsite.dk
Subject: Re: Test Failures from latest CVS
Date: Sat, 4 Sep 2004 09:38:26 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.61.0409040927360.1742@toltec.zanshin.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0409040810260.1742@toltec.zanshin.com>

On Sat, 4 Sep 2004, Bart Schaefer wrote:

> PWS got something subtly wrong in zsh-workers/20308.  I haven't figured
> out what yet.  Maybe he'll beat me to it.

The scriptname has to be changed before the string to be eval'd is parsed. 
Peter tried (or so I presume) to fix a long-standing bug that scriptname 
would not be restored properly on a parse error, by delaying the change 
rather than by explicitly restoring; but also neglected to restore ineval 
to its previous state in the same circumstance.  (Is there a reason not to 
assign lastval in that case also?  It could simplify the code structure.)

Index: Src/builtin.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/builtin.c,v
retrieving revision 1.123
diff -u -r1.123 builtin.c
--- Src/builtin.c	3 Sep 2004 09:47:49 -0000	1.123
+++ Src/builtin.c	4 Sep 2004 16:27:03 -0000
@@ -4235,16 +4235,18 @@
      * we use a special script name to indicate the special line number.
      */
     ineval = !isset(EVALLINENO);
+    if (!ineval)
+	scriptname = "(eval)";
 
     prog = parse_string(zjoin(argv, ' ', 1));
     if (!prog) {
 	errflag = 0;
+        scriptname = oscriptname;
+        ineval = oineval;
 	return 1;
     }
 
     lastval = 0;
-    if (!ineval)
-	scriptname = "(eval)";
 
     execode(prog, 1, 0);
 
@@ -4253,8 +4255,7 @@
 	errflag = 0;
     }
 
-    if (!ineval)
-	scriptname = oscriptname;
+    scriptname = oscriptname;
     ineval = oineval;
 
     return lastval;


  reply	other threads:[~2004-09-04 16:38 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 [this message]
2004-09-05 17:36     ` Peter Stephenson
2004-09-05 18:12       ` Bart Schaefer
  -- 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.0409040927360.1742@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).