Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: 3.1.6: Extra slash in $PWD (Re: prompt bug?)



On Sep 26,  5:36pm, Gabor wrote:
} Subject: prompt bug?
}
} I discovered this interesting anomoly in my prompt
} 
} PS1='=== %(3/;%2/;%/) $ '
} === //tmp $ 

I'm still hoping to have a more detailed look at "cd" and friends, but
this was quick'n'dirty.  Line numbers may be off a tad.

Index: Src/builtin.c
===================================================================
@@ -963,7 +963,8 @@
 	buf = ztrdup(dest);
     else {
 	dlen = strlen(pwd);
-
+	if (pwd[dlen-1] == '/')
+	    --dlen;
 	buf = zalloc(dlen + strlen(dest) + 2);
 	strcpy(buf, pwd);
 	buf[dlen] = '/';

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



Messages sorted by: Reverse Date, Date, Thread, Author