diff options
author | Bart Schaefer <barts@users.sourceforge.net> | 2012-03-01 03:35:04 +0000 |
---|---|---|
committer | Bart Schaefer <barts@users.sourceforge.net> | 2012-03-01 03:35:04 +0000 |
commit | 30361b650cd85bdac90a22e0517844586124ae38 (patch) | |
tree | e8f06277721801c36e4de0f945d35e2fd5d61a94 | |
parent | b227ff16da89d48f9e50347ceb4839fc9a36c7dd (diff) | |
download | zsh-30361b650cd85bdac90a22e0517844586124ae38.tar.gz zsh-30361b650cd85bdac90a22e0517844586124ae38.tar.xz zsh-30361b650cd85bdac90a22e0517844586124ae38.zip |
30184: use a HASH_EXECUTABLES_ONLY test that matches the test used by
exec.c:iscom() during path search.
-rw-r--r-- | Src/hashtable.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Src/hashtable.c b/Src/hashtable.c index 775b6a277..be71a1cc9 100644 --- a/Src/hashtable.c +++ b/Src/hashtable.c @@ -664,7 +664,8 @@ hashdir(char **dirp) * executable plain files. */ if (unset(HASHEXECUTABLESONLY) || - (stat(pathbuf, &statbuf) == 0 && + (access(pathbuf, X_OK) == 0 && + stat(pathbuf, &statbuf) == 0 && S_ISREG(statbuf.st_mode) && (statbuf.st_mode & S_IXUGO))) add = 1; } |