Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
cdpath and empty string
- X-seq: zsh-workers 31635
- From: Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: cdpath and empty string
- Date: Wed, 7 Aug 2013 04:49:38 -0400
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d201210; h=Content-Type:MIME-Version:Message-ID:Subject:To:From:Date; bh=DsxhHijMx+UYRA3GDHgkHcQ/YjCslA1pU6kV+DArwnk=; b=leQ2gd8BJf3v02Ha2JZzVayoDfvygrZoNn0EyV9FdpG71faTdrpJN9NJhtgCQRbC0wxtxqYVDOHl9rZpWC3B4u/+c/jc7Ac8ssokP7kZU3XO+T2NfTtpLac9AYWpVbtFRzjuPxmfKEAhmle10sIEMj4gpc/fUDncqYtPWSJEMlo=;
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mail-followup-to: zsh-workers@xxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author