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

Re: BUG: cd '' doesn't produce an error

Ulrik Haugen <qha@xxxxxxxxxxxxxx> wrote:
> I recently discovered that zsh (versions 4.2.5 and 4.3.0-dev-1)
> doesn't produce an error when i attempt to "cd ''" (in version 3.0.8 I
> get the error i expected). Please let me know if you'd like me to test
> any other versions.

It's certainly strange, although it's not wholly illogical with $cdpath: as
the empty string is not an absolute directory nor begins with . or .., the
shell looks through $cdpath for the first directory for which the
concatenation with the empty string exists, which is usually just the first
directory in $cdpath.  This is almost useful...  It's easy to add an error
but I'm not quite sure at what stage the behaviour actually is an error in
this case: it's a correct, if unexpected, interpretation of the cdpath

Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070

This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com

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