about summary refs log tree commit diff
path: root/Src/builtin.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/builtin.c')
-rw-r--r--Src/builtin.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Src/builtin.c b/Src/builtin.c
index c0b716d45..088608138 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -943,7 +943,8 @@ cd_try_chdir(char *pfix, char *dest, int hard)
 	buf = ztrdup(dest);
     else {
 	dlen = strlen(pwd);
-
+	if (pwd[dlen-1] == '/')
+	    --dlen;
 	buf = zalloc(dlen + strlen(dest) + 2);
 	strcpy(buf, pwd);
 	buf[dlen] = '/';