diff options
| author | Mikael Magnusson <mikachu@gmail.com> | 2026-05-26 17:24:40 +0200 |
|---|---|---|
| committer | Mikael Magnusson <mikachu@gmail.com> | 2026-06-04 05:45:50 +0200 |
| commit | 0883f8fec6d08780229f239ce0c3455efe19a198 (patch) | |
| tree | 9b8cfd2c766d6147da2cf183e735a8d2ec4412c4 /Test/V06parameter.ztst | |
| parent | unposted: remove further remnant of restricted mode (diff) | |
| download | zsh-0883f8fec6d08780229f239ce0c3455efe19a198.tar zsh-0883f8fec6d08780229f239ce0c3455efe19a198.tar.gz zsh-0883f8fec6d08780229f239ce0c3455efe19a198.tar.bz2 zsh-0883f8fec6d08780229f239ce0c3455efe19a198.tar.lz zsh-0883f8fec6d08780229f239ce0c3455efe19a198.tar.xz zsh-0883f8fec6d08780229f239ce0c3455efe19a198.tar.zst zsh-0883f8fec6d08780229f239ce0c3455efe19a198.zip | |
54617: fix lookup in $commands array when hashlistall is unset
While the documentation for the zsh/parameter module does state
The zsh/parameter module gives access to some of the internal hash tables
and
commands
This array gives access to the command hash table.
, the latter entry does *also* say
values are the pathnames of the files that would be executed when
the command would be invoked.
Change getpmcommand to always do a lookup via findcmd() if it the entry
is not found in the hash and HASHLISTALL is unset. This will indirectly
respect HASHCMDS and add the single entry if it is set, look it up in
the hash if it was added and then HASHCMDS was unset, etc.
Diffstat (limited to 'Test/V06parameter.ztst')
| -rw-r--r-- | Test/V06parameter.ztst | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Test/V06parameter.ztst b/Test/V06parameter.ztst index 27d587852..c1f47a9dc 100644 --- a/Test/V06parameter.ztst +++ b/Test/V06parameter.ztst @@ -92,6 +92,25 @@ >foo >bar + for 1 in hash_cmds no_hash_cmds; do + ( + setopt no_hash_list_all $1 + : > ls + chmod +x ls + rm=$commands[rm] + path=( $PWD ) + rehash + a=$commands[ls] + $rm ls + b=$commands[ls] + [[ $a == $b ]] + print -r - $? $a:$b + ) + done +-:workers/54617: $commands look-up with no_hash_list_all +*>0 */ls:*/ls +*>1 */ls: + %clean rm -f autofn functrace.zsh rocky3.zsh sourcedfile myfunc |
