summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Doc/Zsh/builtins.yo4
-rw-r--r--Src/exec.c2
3 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 2196db3de..d478b3307 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2019-03-19 Peter Stephenson <p.stephenson@samsung.com>
+ * Charles Blake: 44132: Src/exec.c, Doc/Zsh/builtins.yo: don't
+ hash commands beginning with a '/'.
+
* 44142: Src/hist.c: fix bug stripping spaces on line with only
comment.
diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo
index cc9832379..a926395ad 100644
--- a/Doc/Zsh/builtins.yo
+++ b/Doc/Zsh/builtins.yo
@@ -988,6 +988,10 @@ The choice of hash table to work on is determined by the tt(-d) option;
without the option the command hash table is used, and with the option the
named directory hash table is used.
+Command paths starting with a tt(/) are never hashed, whether by explicit
+use of the tt(hash) command or otherwise, but are always found
+by direct look up in the file system.
+
Given no arguments, and neither the tt(-r) or tt(-f) options,
the selected hash table will be listed in full.
diff --git a/Src/exec.c b/Src/exec.c
index 042ba065a..79ef83c1e 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -940,6 +940,8 @@ hashcmd(char *arg0, char **pp)
char *s, buf[PATH_MAX+1];
char **pq;
+ if (*arg0 == '/')
+ return NULL;
for (; *pp; pp++)
if (**pp == '/') {
s = buf;