about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-08-26 07:51:46 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-08-26 07:51:46 +0000
commitec1c4d6aca7b793d5ccf4235b3582473bb7fae90 (patch)
treef29ccfb48f1bccdf53f4f529488e15fd20e5c2cd /Src
parent59bbba17499d2b617835625010fb2ada824194f7 (diff)
downloadzsh-ec1c4d6aca7b793d5ccf4235b3582473bb7fae90.tar.gz
zsh-ec1c4d6aca7b793d5ccf4235b3582473bb7fae90.tar.xz
zsh-ec1c4d6aca7b793d5ccf4235b3582473bb7fae90.zip
zsh-workers/7490
Diffstat (limited to 'Src')
-rw-r--r--Src/exec.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/Src/exec.c b/Src/exec.c
index d37acd902..f2897499e 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -615,16 +615,12 @@ iscom(char *s)
 int
 isreallycom(Cmdnam cn)
 {
-    if (cn->flags & HASHED)
-	return 1;
-    else {
-	char fullnam[MAXCMDLEN];
+    char fullnam[MAXCMDLEN];
 
-	strcpy(fullnam, cn->u.name ? *(cn->u.name) : "");
-	strcat(fullnam, "/");
-	strcat(fullnam, cn->nam);
-	return iscom(fullnam);
-    }
+    strcpy(fullnam, cn->u.name ? *(cn->u.name) : "");
+    strcat(fullnam, "/");
+    strcat(fullnam, cn->nam);
+    return iscom(fullnam);
 }
 
 /**/
@@ -1689,7 +1685,8 @@ execcmd(Cmd cmd, int input, int output, int how, int last1)
 	    char *cmdarg = (char *) peekfirst(args);
 
 	    hn = cmdnamtab->getnode(cmdnamtab, cmdarg);
-	    if (hn && trycd && !isreallycom((Cmdnam)hn)) {
+	    if (hn && trycd && !(((Cmdnam)hn)->flags & HASHED) &&
+		!isreallycom((Cmdnam)hn)) {
 		cmdnamtab->removenode(cmdnamtab, cmdarg);
 		cmdnamtab->freenode(hn);
 		hn = NULL;