From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29717 invoked from network); 1 Mar 1999 09:08:03 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 1 Mar 1999 09:08:03 -0000 Received: (qmail 5392 invoked by alias); 1 Mar 1999 09:07:24 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5559 Received: (qmail 5371 invoked from network); 1 Mar 1999 09:07:23 -0000 Message-Id: <9903010851.AA39289@ibmth.df.unipi.it> To: zsh-workers@sunsite.auc.dk (Zsh hackers list) Subject: PATCH: 3.1.5 genericish: cd /.. In-Reply-To: "Mircea Damian"'s message of "Sun, 28 Feb 1999 21:11:59 NFT." <19990228211159.A30631@kappa.ro> Date: Mon, 01 Mar 1999 09:51:10 +0100 From: Peter Stephenson Mircea Damian wrote: > dmircea@secu:~% cd / > dmircea@secu:/% cd ../bin > dmircea@secu:/../bin% pwd > /../bin I thought this might be to do with the RFS superroot, but that's tested further up, so it's not. So the simplest fix ought to be OK. (Arguably you shouldn't test things like that in configure, but RFS isn't so common.) --- Src/builtin.c.dd Wed Feb 10 17:35:28 1999 +++ Src/builtin.c Mon Mar 1 09:46:41 1999 @@ -1072,12 +1072,14 @@ *dest = '\0'; return; } - if (dest > d0 + 1 && src[0] == '.' && src[1] == '.' && + if (src[0] == '.' && src[1] == '.' && (src[2] == '\0' || src[2] == '/')) { - /* remove a foo/.. combination */ - for (dest--; dest > d0 + 1 && dest[-1] != '/'; dest--); - if (dest[-1] != '/') - dest--; + if (dest > d0 + 1) { + /* remove a foo/.. combination */ + for (dest--; dest > d0 + 1 && dest[-1] != '/'; dest--); + if (dest[-1] != '/') + dest--; + } src++; while (*++src == '/'); } else if (src[0] == '.' && (src[1] == '/' || src[1] == '\0')) { -- Peter Stephenson Tel: +39 050 844536 WWW: http://www.ifh.de/~pws/ Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy