From 30361b650cd85bdac90a22e0517844586124ae38 Mon Sep 17 00:00:00 2001 From: Bart Schaefer Date: Thu, 1 Mar 2012 03:35:04 +0000 Subject: 30184: use a HASH_EXECUTABLES_ONLY test that matches the test used by exec.c:iscom() during path search. --- Src/hashtable.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Src/hashtable.c') 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; } -- cgit 1.4.1