From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9298 invoked by alias); 28 Sep 2015 18:13:23 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 36681 Received: (qmail 15412 invoked from network); 28 Sep 2015 18:13:22 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 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= X-Sasl-enc: 6y+o3MznX1UpQRtI6nrQ5zT6nmBUcOPP53p6ZZN7qihI 1443464000 Date: Mon, 28 Sep 2015 18:13:15 +0000 From: Daniel Shahaf To: Bart Schaefer Cc: Zsh hackers list , Stephane Chazelas Subject: Re: bug with $PWD in / Message-ID: <20150928181315.GB4921@tarsus.local2> References: <20150916162630.GA6436@chaz.gmail.com> <150919110800.ZM22888@torch.brasslantern.com> <20150919192850.GB6421@chaz.gmail.com> <150919134740.ZM23592@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <150919134740.ZM23592@torch.brasslantern.com> User-Agent: Mutt/1.5.21 (2010-09-15) 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)))