zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: Zsh 3.1.6 - ${~foo} expansion bug
Date: Tue, 8 Feb 2000 10:25:35 +0100 (MET)	[thread overview]
Message-ID: <200002080925.KAA01349@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Bart Schaefer"'s message of Mon, 7 Feb 2000 21:19:29 -0800


Bart Schaefer wrote:

> On Feb 8, 12:16am, Alexandre Duret-Lutz wrote:
> > Subject: Re: Zsh 3.1.6 - ${~foo} expansion bug
> >
> > From my experiments I am tempted to deduce that this is
> > reproducible as long as you don't call a builtin before
> > the for loop.
> 
> This is exactly correct; I recompiled with --disable-zshenv to be
> absolutely certain that no commands were executed by "zsh -f",
> and now I can reproduce the problem as well.
> 
> Tracing through, I find that after a builtin has been executed,
> the `esglob' == 1 at exec.c:1516.  The first time through the "for"
> loop, when it misbehaves, `esglob' == 0.  And sure enough, esglob
> is a static which is not initialized until execcmd() is called.
> 
> I imagine there some similar problem with `esprefork'.  I don't
> know where these should be getting initialized, though, nor what
> the right starting value for `esprefork' should be, though `esglob'
> clearly ought to be initialized to 1.

The initialisation to `1' for esglob in the patch below shouldn't
really be necessary, because both es* should be set up when one of the 
functions calling execsubst() will be called.

What really confused me is that the test was still in the order in
which it was. I *know* I once changed that -- obviously I didn't send
a patch for it.

Sorry!

Bye
 Sven

diff -ru ../z.old/Src/exec.c Src/exec.c
--- ../z.old/Src/exec.c	Tue Feb  8 10:16:04 2000
+++ Src/exec.c	Tue Feb  8 10:22:15 2000
@@ -1506,7 +1506,7 @@
     }
 }
 
-static int esprefork, esglob;
+static int esprefork, esglob = 1;
 
 /**/
 void
@@ -1917,10 +1917,10 @@
 	is_exec = 1;
     }
 
-    if (args && (esglob = !(cflags & BINF_NOGLOB))) {
+    if ((esglob = !(cflags & BINF_NOGLOB)) && args) {
 	LinkList oargs = args;
 	globlist(args);
-	args=oargs;
+	args = oargs;
     }
     if (errflag) {
 	lastval = 1;

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


             reply	other threads:[~2000-02-08  9:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-02-08  9:25 Sven Wischnowsky [this message]
2000-02-11 19:27 ` Peter Stephenson
  -- strict thread matches above, loose matches on Subject: below --
2000-02-14  9:13 Sven Wischnowsky
2000-02-07 20:49 Jukka Laurila
2000-02-07 21:40 ` Bart Schaefer
2000-02-07 22:29   ` Jukka Laurila
2000-02-07 23:16     ` Alexandre Duret-Lutz
2000-02-08  5:19       ` Bart Schaefer
2000-02-07 23:25     ` Thomas Köhler

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=200002080925.KAA01349@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.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).