From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 40 invoked from network); 4 Sep 2004 16:38:38 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 4 Sep 2004 16:38:38 -0000 Received: (qmail 3602 invoked from network); 4 Sep 2004 16:38:33 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 4 Sep 2004 16:38:33 -0000 Received: (qmail 1295 invoked by alias); 4 Sep 2004 16:38:31 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20318 Received: (qmail 1282 invoked from network); 4 Sep 2004 16:38:30 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 4 Sep 2004 16:38:30 -0000 Received: (qmail 3345 invoked from network); 4 Sep 2004 16:38:30 -0000 Received: from moonbase.zanshin.com (64.84.47.139) by a.mx.sunsite.dk with SMTP; 4 Sep 2004 16:38:28 -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 i84GcQap008066 for ; Sat, 4 Sep 2004 09:38:26 -0700 Date: Sat, 4 Sep 2004 09:38:26 -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: Message-ID: References: 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=none autolearn=no version=2.63 X-Spam-Hits: 0.0 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;