From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29231 invoked from network); 14 Jul 1999 08:37:21 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 14 Jul 1999 08:37:21 -0000 Received: (qmail 18606 invoked by alias); 14 Jul 1999 08:37:11 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7125 Received: (qmail 18599 invoked from network); 14 Jul 1999 08:37:10 -0000 Message-Id: <9907140806.AA18161@ibmth.df.unipi.it> To: "ZSH workers mailing list" Subject: Re: 3.1.6-test-1: strange cd behaviour In-Reply-To: ""Andrej Borsenkow""'s message of "Tue, 13 Jul 1999 19:29:02 DFT." <000001becd44$6f3a3b30$21c9ca95@mow.siemens.ru> Date: Wed, 14 Jul 1999 10:06:10 +0200 From: Peter Stephenson "Andrej Borsenkow" wrote: > (/tools/src is in cdpath) > > bor@itsrm2:/tools/src/zsh-3.1.6-test-1%> builtin cd zsh-3.1.6-test-1/.. > bor@itsrm2:/tools/src/zsh-3.1.6-test-1%> echo $? > 0 > > That is, cd does not change directory and returns success. 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 `.'? It certainly looks like a bug to me, because the unspoken assumption is that cd will fail unless the path you've given it is valid as it stands --- and it isn't, chdir() would fail if given the raw path. However, I ought to point out that bash and some versions of ksh (but not sh, which is too dumb to massage paths, and not csh or tcsh either, and not some other versions of ksh) silently accept this. I wrote a patch for this, but unfortunately there's a real problem. 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. -- Peter Stephenson Tel: +39 050 844536 WWW: http://www.ifh.de/~pws/ Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy