From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19817 invoked from network); 13 Mar 2002 11:36:32 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 13 Mar 2002 11:36:32 -0000 Received: (qmail 10639 invoked by alias); 13 Mar 2002 11:36:18 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 4753 Received: (qmail 10628 invoked from network); 13 Mar 2002 11:36:17 -0000 X-VirusChecked: Checked Date: Wed, 13 Mar 2002 11:35:48 +0000 From: Oliver Kiddle To: zsh-users@sunsite.dk Subject: Re: Inconsistent behaviour of cd and AUTO_CD Message-ID: <20020313113548.GA14683@logica.com> References: <20020309234651.GA23412@greux.loria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020309234651.GA23412@greux.loria.fr> User-Agent: Mutt/1.3.27i Sender: Oliver Kiddle Vincent Lefevre wrote: > With zsh 4.0.4 and AUTO_CD, under Linux and ext3 filesystem type: > > ay:~> mkdir blah > ay:~> cd blah > ay:~/blah> .. > ay:~> cd blah > ay:~/blah> rmdir ../blah > ay:~/blah> .. > zsh: permission denied: .. > zsh: exit 1 .. > ay:~/blah[Failed 1]> cd .. > ay:~> Yes, clearly this is inconsistent. If you set either of the chase_links or chase_dots options, the .. implicit cd will work like the explicit one. Note that I don't think the filesystem type, operating system or zsh version makes any difference to this (except IRIX doesn't let me remove the directory). In fact, even tcsh has this exact same inconsistency. The problem is in the cancd2() function in exec.c. It only tries an implicit cd after establishing that the target is an accessible directory. With chase_dots, it first resolves the target to $PWD:h so it works. And for the cd command it doesn't have to decide what it is doing so it just does the cd. So cancd2() somehow needs to do a better job of resolving what the target directory is before determining if it is accessible. I don't fully understand the semantics of no_chase_dots to know how it should do this. Any ideas? Oliver -- This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.