34989: AUTO_CD needs to call cd --.

Otherwise directories looking like options do the wrong thing.
This commit is contained in:
Peter Stephenson 2015-04-28 20:42:26 +01:00
parent 4096469b34
commit c96a993d51
2 changed files with 6 additions and 0 deletions

View File

@ -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

View File

@ -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;