about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--Src/builtin.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index d27000788..74e0ebeb5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-08-17  Barton E. Schaefer  <schaefer@zsh.org>
+
+	* 31637: Src/builtin.c: change of directory should not be retried
+	relative to the current directory when it has already failed along
+	some path that does not refer to the current directory.
+
 2013-08-11  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
 	* 31650: Src/utils.c: use zlong for mailcheck parameters to
diff --git a/Src/builtin.c b/Src/builtin.c
index 3159975e3..f8be4acc9 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -1125,7 +1125,8 @@ cd_try_chdir(char *pfix, char *dest, int hard)
      * argument to cd relatively.  This is useful if the cwd
      * or a parent directory is renamed in the interim.
      */
-    if (lchdir(buf, NULL, hard) && lchdir(dest, NULL, hard)) {
+    if (lchdir(buf, NULL, hard) &&
+	(pfix || *dest == '/' || lchdir(dest, NULL, hard))) {
 	free(buf);
 	return NULL;
     }