diff options
| author | Mikael Magnusson <mikachu@gmail.com> | 2026-05-26 19:30:47 +0200 |
|---|---|---|
| committer | Mikael Magnusson <mikachu@gmail.com> | 2026-06-04 05:46:09 +0200 |
| commit | d092cf6f18f9ba15e9709ed11aafd7e13cf7ae7a (patch) | |
| tree | b20ffe3ba67cd061c318342aa27edfed5d91cc59 | |
| parent | 54617: fix lookup in $commands array when hashlistall is unset (diff) | |
| download | zsh-d092cf6f18f9ba15e9709ed11aafd7e13cf7ae7a.tar zsh-d092cf6f18f9ba15e9709ed11aafd7e13cf7ae7a.tar.gz zsh-d092cf6f18f9ba15e9709ed11aafd7e13cf7ae7a.tar.bz2 zsh-d092cf6f18f9ba15e9709ed11aafd7e13cf7ae7a.tar.lz zsh-d092cf6f18f9ba15e9709ed11aafd7e13cf7ae7a.tar.xz zsh-d092cf6f18f9ba15e9709ed11aafd7e13cf7ae7a.tar.zst zsh-d092cf6f18f9ba15e9709ed11aafd7e13cf7ae7a.zip | |
54620: fix check for when to hash commands
| -rw-r--r-- | ChangeLog | 2 | ||||
| -rw-r--r-- | Src/exec.c | 4 |
2 files changed, 4 insertions, 2 deletions
@@ -1,5 +1,7 @@ 2026-06-04 Mikael Magnusson <mikachu@gmail.com> + * 54620: Src/exec.c: fix check for when to hash commands + * 54617: Src/Modules/parameter.c, Src/zsh.h, Test/V06parameter.ztst: fix lookup in $commands array when hashlistall is unset diff --git a/Src/exec.c b/Src/exec.c index c71cd3614..c1393a384 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -933,7 +933,7 @@ findcmd(char *arg0, int docopy, int default_path) return NULL; } cn = (Cmdnam) cmdnamtab->getnode(cmdnamtab, arg0); - if (!cn && isset(HASHCMDS) && !isrelative(arg0)) + if (!cn && isset(HASHCMDS)) cn = hashcmd(arg0, path); if ((int) ztrlen(arg0) >= PATH_MAX) return NULL; @@ -1051,7 +1051,7 @@ hashcmd(char *arg0, char **pp) char *s, buf[MAXCMDLEN]; char **pq; - if (*arg0 == '/') + if ((*arg0 == '/') || !strncmp(arg0, "./", 2) || !strncmp(arg0, "../", 3)) return NULL; for (; *pp; pp++) if (**pp == '/') { |
