Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

cdpath and empty string



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