about summary refs log tree commit diff
path: root/Src/hashtable.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2012-01-08 16:02:54 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2012-01-08 16:02:54 +0000
commitc214b86e9456b2e5eda47bc7710ced0c455df70e (patch)
treeba61292c2eaa78531ac5232d3535334e0d4ab7cf /Src/hashtable.c
parent59ff3c692096a671c5b78669f39e7b1e5d00df62 (diff)
downloadzsh-c214b86e9456b2e5eda47bc7710ced0c455df70e.tar.gz
zsh-c214b86e9456b2e5eda47bc7710ced0c455df70e.tar.xz
zsh-c214b86e9456b2e5eda47bc7710ced0c455df70e.zip
30101: add HASH_EXECUTABLES_ONLY option
Diffstat (limited to 'Src/hashtable.c')
-rw-r--r--Src/hashtable.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Src/hashtable.c b/Src/hashtable.c
index 6fca256e3..775b6a277 100644
--- a/Src/hashtable.c
+++ b/Src/hashtable.c
@@ -663,8 +663,9 @@ hashdir(char **dirp)
 		 * This is the same test as for the glob qualifier for
 		 * executable plain files.
 		 */
-		if (stat(pathbuf, &statbuf) == 0 &&
-		    S_ISREG(statbuf.st_mode) && (statbuf.st_mode & S_IXUGO))
+		if (unset(HASHEXECUTABLESONLY) ||
+		    (stat(pathbuf, &statbuf) == 0 &&
+		     S_ISREG(statbuf.st_mode) && (statbuf.st_mode & S_IXUGO)))
 		    add = 1;
 	    }
 	    if (add) {