30184: use a HASH_EXECUTABLES_ONLY test that matches the test used by

exec.c:iscom() during path search.
This commit is contained in:
Bart Schaefer 2012-03-01 03:35:04 +00:00
parent b227ff16da
commit 30361b650c
1 changed files with 2 additions and 1 deletions

View File

@ -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;
}