about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-08-27 18:24:28 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-08-27 18:24:28 +0000
commit878966e6b94b1b5222be9100af8d84fa3479e4a7 (patch)
tree2c209c6a67686abd9478e4a95c43b52090a4db69 /Src
parent408695927c860762fe23d29090d176ccfb460ff7 (diff)
downloadzsh-878966e6b94b1b5222be9100af8d84fa3479e4a7.tar.gz
zsh-878966e6b94b1b5222be9100af8d84fa3479e4a7.tar.xz
zsh-878966e6b94b1b5222be9100af8d84fa3479e4a7.zip
manual/7521
Diffstat (limited to 'Src')
-rw-r--r--Src/exec.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/Src/exec.c b/Src/exec.c
index f2897499e..4ebbf1307 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -617,9 +617,15 @@ isreallycom(Cmdnam cn)
 {
     char fullnam[MAXCMDLEN];
 
-    strcpy(fullnam, cn->u.name ? *(cn->u.name) : "");
-    strcat(fullnam, "/");
-    strcat(fullnam, cn->nam);
+    if (cn->flags & HASHED)
+	strcpy(fullnam, cn->u.cmd);
+    else if (!cn->u.name)
+	return 0;
+    else {
+	strcpy(fullnam, cn->u.name);
+	strcat(fullnam, "/");
+	strcat(fullnam, cn->nam);
+    }
     return iscom(fullnam);
 }
 
@@ -1685,8 +1691,7 @@ execcmd(Cmd cmd, int input, int output, int how, int last1)
 	    char *cmdarg = (char *) peekfirst(args);
 
 	    hn = cmdnamtab->getnode(cmdnamtab, cmdarg);
-	    if (hn && trycd && !(((Cmdnam)hn)->flags & HASHED) &&
-		!isreallycom((Cmdnam)hn)) {
+	    if (hn && trycd && !isreallycom((Cmdnam)hn)) {
 		cmdnamtab->removenode(cmdnamtab, cmdarg);
 		cmdnamtab->freenode(hn);
 		hn = NULL;