zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@ibmth.df.unipi.it>
To: zsh-workers@sunsite.auc.dk (Zsh hackers list)
Subject: PATCH: 3.1.5 genericish: cd /..
Date: Mon, 01 Mar 1999 09:51:10 +0100	[thread overview]
Message-ID: <9903010851.AA39289@ibmth.df.unipi.it> (raw)
In-Reply-To: "Mircea Damian"'s message of "Sun, 28 Feb 1999 21:11:59 NFT." <19990228211159.A30631@kappa.ro>

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@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


           reply	other threads:[~1999-03-01  9:08 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <19990228211159.A30631@kappa.ro>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9903010851.AA39289@ibmth.df.unipi.it \
    --to=pws@ibmth.df.unipi.it \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).