Permalink
Browse files

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

exec.c:iscom() during path search.
  • Loading branch information...
1 parent b227ff1 commit 30361b650cd85bdac90a22e0517844586124ae38 Bart Schaefer committed Mar 1, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 Src/hashtable.c
View
@@ -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;
}

0 comments on commit 30361b6

Please sign in to comment.