about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-09-29 05:47:46 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-09-29 05:47:46 +0000
commitd3a25d6d2c969d3c630c20a085f0623ebef0a6f2 (patch)
tree712a96831f93c8f499fa701fb078a729cd31d686 /Src
parent931523b2136e9edfe50b1246f0f19907b33d20be (diff)
downloadzsh-d3a25d6d2c969d3c630c20a085f0623ebef0a6f2.tar.gz
zsh-d3a25d6d2c969d3c630c20a085f0623ebef0a6f2.tar.xz
zsh-d3a25d6d2c969d3c630c20a085f0623ebef0a6f2.zip
zsh-workers/8091
Diffstat (limited to 'Src')
-rw-r--r--Src/exec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Src/exec.c b/Src/exec.c
index 710402f86..7a6ed15e4 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -1692,14 +1692,16 @@ execcmd(Cmd cmd, int input, int output, int how, int last1)
 	if (!hn) {
 	    /* Resolve external commands */
 	    char *cmdarg = (char *) peekfirst(args);
+	    int dohashcmd = isset(HASHCMDS);
 
 	    hn = cmdnamtab->getnode(cmdnamtab, cmdarg);
 	    if (hn && trycd && !isreallycom((Cmdnam)hn)) {
 		cmdnamtab->removenode(cmdnamtab, cmdarg);
 		cmdnamtab->freenode(hn);
 		hn = NULL;
+		dohashcmd = 1;
 	    }
-	    if (!hn && isset(HASHCMDS) && strcmp(cmdarg, "..")) {
+	    if (!hn && dohashcmd && strcmp(cmdarg, "..")) {
 		for (s = cmdarg; *s && *s != '/'; s++);
 		if (!*s)
 		    hn = (HashNode) hashcmd(cmdarg, pathchecked);