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

Re: 3.1.6-test-1: strange cd behaviour



On Jul 14, 10:06am, Peter Stephenson wrote:
} Subject: Re: 3.1.6-test-1: strange cd behaviour
}
} I take it what you're really complaining about is that there is no
} subdirectory zsh-3.1.6-test-1 at that point, i.e. 
}   cd anyolddirectorynameatallatall/..
} always succeeds and leaves you in `.'?
} 
} Consider:
} 
} % mkdir ~/tmp/d1
} % cd ~/tmp/d1
} % rm -rf ~/tmp/d1
} % cd ..
} 
} Currently that works fine:  since tmp exists, it changes directory there.
} However, if you insist on the initial directory being valid, then
} (for example) statting ~/tmp/d1/.. will fail, and the cd won't work.
} Furthermore, you can't even stat the relative path "..", since that's gone
} too.  So I don't see a way of reconciling the two things.

It worked (and still works) in 3.0.  What changed?

zagzig% echo $ZSH_VERSION
3.0.6-pre-5
zagzig% cd dummy/..
cd: no such file or directory: dummy/..
zagzig% cd /tmp/foo
zagzig% mkdir fred
zagzig% cd fred
zagzig% rmdir /tmp/foo/fred
zagzig% cd ..
zagzig% pwd
/tmp/foo
zagzig% cd fred/..
cd: no such file or directory: fred/..

zagzig% echo $ZSH_VERSION
3.1.6-test-1
zagzig% pwd
/usr/src/local/zsh/zsh-3.1.5-build
zagzig% cd dummy/..
zagzig% pwd
/usr/src/local/zsh/zsh-3.1.5-build
zagzig% cd /tmp/foo
zagzig% cd fred/..
zagzig% pwd
/tmp/foo
zagzig% mkdir fred
zagzig% cd fred
zagzig% rmdir /tmp/foo/fred
zagzig% cd ..
zagzig% pwd
/tmp/foo
zagzig% cd fred/..
zagzig% pwd
/tmp/foo


-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



Messages sorted by: Reverse Date, Date, Thread, Author