about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorPeter Stephenson <p.w.stephenson@ntlworld.com>2015-04-28 20:42:26 +0100
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2015-04-28 20:42:26 +0100
commitc96a993d51e3e5958c8161d0dbe86cb43bcc52c1 (patch)
tree6b19249e983f72faa4be597d7efb581875984e08 /Src
parent4096469b345224a9c1a7c8160ffb63cd4b7e6dc3 (diff)
downloadzsh-c96a993d51e3e5958c8161d0dbe86cb43bcc52c1.tar.gz
zsh-c96a993d51e3e5958c8161d0dbe86cb43bcc52c1.tar.xz
zsh-c96a993d51e3e5958c8161d0dbe86cb43bcc52c1.zip
34989: AUTO_CD needs to call cd --.
Otherwise directories looking like options do the wrong thing.
Diffstat (limited to 'Src')
-rw-r--r--Src/exec.c1
1 files changed, 1 insertions, 0 deletions
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;