summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/exec.c1
2 files changed, 6 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index d53fe38dc..a5987b764 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-28  Peter Stephenson  <p.w.stephenson@ntlworld.com>
+
+	* 34989: Src/exec.c: AUTOCD needs to pass -- to cd to avoid
+	directory being treated as option.
+
 2015-04-28  Peter Stephenson  <p.stephenson@samsung.com>
 
 	* Jared Ahern: 34980: Completion/Unix/Command/_make: expanding
diff --git a/Src/exec.c b/Src/exec.c
index 31c80a74e..6a8b35a36 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -2930,6 +2930,7 @@ execcmd(Estate state, int input, int output, int how, int last1)
 	 * is a directory we should AUTOCD to. */
 	if (!hn && trycd && (s = cancd(peekfirst(args)))) {
 	    peekfirst(args) = (void *) s;
+	    pushnode(args, dupstring("--"));
 	    pushnode(args, dupstring("cd"));
 	    if ((hn = builtintab->getnode(builtintab, "cd")))
 		is_builtin = 1;