zsh-workers
 help / color / mirror / code / Atom feed
From: Phil Pennock <zsh-workers+phil.pennock@spodhuis.org>
To: zsh-workers@zsh.org
Subject: cdpath and empty string
Date: Wed, 7 Aug 2013 04:49:38 -0400	[thread overview]
Message-ID: <20130807084938.GA94638@redoubt.spodhuis.org> (raw)

Finally got irritated enough to track down what's required to trigger
what looks like a zsh bug.

    % mkdir /tmp/T1 /tmp/T2 /tmp/T2/T1
    % zsh -f
    redoubt% typeset -a cdpath
    redoubt% cdpath=(/tmp/T1 '')
    redoubt% cd /tmp/T2
    redoubt% cd T1
    /tmp/T1/T1
    redoubt% pwd
    /tmp/T2/T1
    redoubt% echo $PWD
    /tmp/T1/T1
    redoubt% cd .
    redoubt% echo $PWD
    /tmp/T2/T1


If $cdpath has an empty string at the end (in my case, using
"${cdpath[@]}" instead of ${cdpath[@]} when prepending elements), then
"cd foo" for unqualified 'foo' which is only found relative to cwd will
always print $cdpath[1]/foo while cd'ing into ./foo.

$PWD is left corrupted, fixed by "cd ."; pwd is fine.

I haven't figured out where this is happening; I know it's in the C, but
reading the code I can't tell where and I need to get back to work
instead of continuing to investigate.  :(

Any thoughts?

-Phil


             reply	other threads:[~2013-08-07  8:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-07  8:49 Phil Pennock [this message]
2013-08-08  1:23 ` Bart Schaefer

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=20130807084938.GA94638@redoubt.spodhuis.org \
    --to=zsh-workers+phil.pennock@spodhuis.org \
    --cc=zsh-workers@zsh.org \
    /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).