From c214b86e9456b2e5eda47bc7710ced0c455df70e Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Sun, 8 Jan 2012 16:02:54 +0000 Subject: 30101: add HASH_EXECUTABLES_ONLY option --- Src/hashtable.c | 5 +++-- Src/options.c | 1 + Src/zsh.h | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) (limited to 'Src') 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) { diff --git a/Src/options.c b/Src/options.c index a70d4ff11..5fbb06b11 100644 --- a/Src/options.c +++ b/Src/options.c @@ -140,6 +140,7 @@ static struct optname optns[] = { {{NULL, "globsubst", OPT_EMULATE|OPT_NONZSH}, GLOBSUBST}, {{NULL, "hashcmds", OPT_ALL}, HASHCMDS}, {{NULL, "hashdirs", OPT_ALL}, HASHDIRS}, +{{NULL, "hashexecutablesonly", 0}, HASHEXECUTABLESONLY}, {{NULL, "hashlistall", OPT_ALL}, HASHLISTALL}, {{NULL, "histallowclobber", 0}, HISTALLOWCLOBBER}, {{NULL, "histbeep", OPT_ALL}, HISTBEEP}, diff --git a/Src/zsh.h b/Src/zsh.h index dda2fa91a..29c8a8319 100644 --- a/Src/zsh.h +++ b/Src/zsh.h @@ -1986,6 +1986,7 @@ enum { GLOBSUBST, HASHCMDS, HASHDIRS, + HASHEXECUTABLESONLY, HASHLISTALL, HISTALLOWCLOBBER, HISTBEEP, -- cgit 1.4.1