From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1637 invoked from network); 13 Dec 1999 21:56:42 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 13 Dec 1999 21:56:42 -0000 Received: (qmail 10770 invoked by alias); 13 Dec 1999 21:56:38 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9028 Received: (qmail 10763 invoked from network); 13 Dec 1999 21:56:37 -0000 Date: Mon, 13 Dec 1999 16:56:21 -0500 From: Clint Adams To: zsh-workers@sunsite.auc.dk Subject: PATCH: more flexible cd builtin Message-ID: <19991213165621.A2898@dman.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.0i If the current directory is renamed, zsh's cd will fail because it's attempting to change to the full path which no longer exists. This allows one to cd to a subdirectory successfully. This is incomplete; `pwd` will become correct, but $PWD will not. Index: Src/builtin.c =================================================================== RCS file: /cvs/zsh/zsh/Src/builtin.c,v retrieving revision 1.1.1.44 diff -u -r1.1.1.44 builtin.c --- Src/builtin.c 1999/12/10 21:40:57 1.1.1.44 +++ Src/builtin.c 1999/12/13 21:51:42 @@ -951,6 +951,7 @@ else unmetafy(buf, &dlen); + if (lchdir(dest, NULL, hard)) /* Try plain relative first */ if (lchdir(buf, NULL, hard)) { free(buf); return NULL;