Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: 3.1.5 genericish: cd /..
- X-seq: zsh-workers 5559
- From: Peter Stephenson <pws@xxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx (Zsh hackers list)
- Subject: PATCH: 3.1.5 genericish: cd /..
- Date: Mon, 01 Mar 1999 09:51:10 +0100
- In-reply-to: "Mircea Damian"'s message of "Sun, 28 Feb 1999 21:11:59 NFT." <19990228211159.A30631@xxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
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 <pws@xxxxxxxxxxxxxxxxx> Tel: +39 050 844536
WWW: http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy
Messages sorted by:
Reverse Date,
Date,
Thread,
Author