Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] Restrict named directories to scalar parameters.



On Mon, Jun 22, 2026 at 6:03 AM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
On Tue, Jun 16, 2026 at 1:43 PM Philippe Altherr
<philippe.altherr@xxxxxxxxx> wrote
>
> Here is an updated patch where the test uses the null PS1 trick.
>
> +   echo "nameddirs=( ${(kv)nameddirs} )"

Noting that this is done because nameddirs is a hidden parameter, so
"typeset -p" won't print its value.  Worth mentioning in the file?

Indeed, I would have prefered using "typeset -p nameddirs". We could add the following comment.

Add comment about "typeset -p nameddirs"

Philippe

diff --git a/Test/K01nameref.ztst b/Test/K01nameref.ztst
index 952bbd30c..95b8e5dbc 100644
--- a/Test/K01nameref.ztst
+++ b/Test/K01nameref.ztst
@@ -1575,6 +1575,7 @@ F:previously this could create an infinite recursion and crash
 
 # Testing named directories requires to run in interactive mode
 
+ # Use "${(kv)nameddirs}" because "typeset -p nameddirs" prints no value
  PS1= $ZTST_testdir/../Src/zsh -fis <<<'
    [[ -d Modules/zsh ]] && module_path=( $PWD/Modules )
    typeset v1=/1 v2


Messages sorted by: Reverse Date, Date, Thread, Author