Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: bug with $PWD in /
- X-seq: zsh-workers 36681
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: bug with $PWD in /
- Date: Mon, 28 Sep 2015 18:13:15 +0000
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>, Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=H2dViWqrJJPrmY7YLFzJ1Ap7q0o=; b=T80YCZ h05+MmCdk3cVmmmWJ7v0+prWlYozR+KGk4B9SsfJzRfpPfHsiz/nQBia8cvtyZ5o n2sljmm41tBssrk1GRoK0ZzN+a6YuCdGCS2cfDX06Pjxp0tfKWZDIviN3ou7COQe 5P6D7HUwQwQANmGii45NwjGDBxj9i1mIAYeAs=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=H2dViWqrJJPrmY7YLFzJ1Ap7q0o=; b=Sutre TIRpbM964rYLrhLrIwCP4HTDp4qF96v3bWEs5uXmbRdgHG9IXg5P5TecwOGfVIhZ OjZWUmeN+BKdL92fQB+7d6diUhJmP/7fpjtRgtkwQNwjv8pYg3OIcUkBGFINyoo3 lnaKmFqfpCIjvhhklHvmG2eYO8JlhNxk03du3A=
- In-reply-to: <150919134740.ZM23592@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20150916162630.GA6436@chaz.gmail.com> <150919110800.ZM22888@torch.brasslantern.com> <20150919192850.GB6421@chaz.gmail.com> <150919134740.ZM23592@torch.brasslantern.com>
Bart Schaefer wrote on Sat, Sep 19, 2015 at 13:47:40 -0700:
> On Sep 19, 8:28pm, Stephane Chazelas wrote:
> } Subject: Re: bug with $PWD in /
> }
> } So, the should recompute $PWD if the one it gets from the
> } environment is a relative path (it's not only about . or ..,
> } think of symlinks).
>
> It'd have to be a symlink from the current directory to itself, tho.
> Other symbolic links are explicitly permitted by the text you quoted.
Looking at the sole caller of ispwd(), setupvals(), it sometimes
initializes $PWD from getenv("HOME"). Is something like this needed,
then?
Or perhaps the condition should be "if not POSIX" rather than "if zsh".
diff --git a/Src/init.c b/Src/init.c
index 22db4b3..24a50c7 100644
--- a/Src/init.c
+++ b/Src/init.c
@@ -1019,7 +1019,7 @@ setupvals(void)
ptr = home;
else
ptr = zgetenv("HOME");
- if (ptr && ispwd(ptr))
+ if (EMULATION(EMULATE_ZSH) && ptr && ispwd(ptr))
pwd = ztrdup(ptr);
else if ((ptr = zgetenv("PWD")) && (strlen(ptr) < PATH_MAX) &&
(ptr = metafy(ptr, -1, META_STATIC), ispwd(ptr)))
Messages sorted by:
Reverse Date,
Date,
Thread,
Author