Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Restrict named directories to scalar parameters.
- X-seq: zsh-workers 54765
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Philippe Altherr <philippe.altherr@xxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: [PATCH] Restrict named directories to scalar parameters.
- Date: Sat, 13 Jun 2026 13:05:47 -0700
- Arc-authentication-results: i=1; mx.google.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ZAAOkoFWTJsWRxeEZVePxRgMBsSiW8aLE+OuhCmuFMI=; fh=RngAOd9wlRc8Glv1v2GOfDUnq2FsyrczungEY8JNfXY=; b=AMxLAwStZNjBs+oTCQlgsFytTrYanpUBTlyWMFHQXX/u3ErN4H7krkh6+6mRlGoqyq l2Brg3Svm8e+dSGFff85zUWtyiZfAyybCbPjtIbrOB43PQS6aqs/eg+eWC/NZ6/95Uui XbDxbLLEoi+UnB3fNxyMJMhSPN8JBUaC4o3y0wDXLuTiOoxnml/NA0ZHs2tZLjH99RIf zOfGqxPzHkjCOtWtqsb67gHtVMEsV02jsbWhgIMhRwRnofqsb1KrmE5ZPqp3W/xst/Ne K5qVPxK7/xS/TqMszEHBz78ygv91xifZ/Q2K0snF3LVonN76PLx9j1ZuE76EYqalncjV pXgA==; darn=zsh.org
- Arc-seal: i=1; a=rsa-sha256; t=1781381159; cv=none; d=google.com; s=arc-20240605; b=kdf4gM5LmW4y9CPpstUm4SLhP83iPilM0NieTduIMySrxQ+KmnbzNcydmoiFtvOC+E ftBFSN/hrlBqQRunI/9PilcOkGAa6sl5Q3t6V/285UsYJC3Ot96/vJ3V/VGxfiyZ0Muz +FrAFAqhL7nGMdwryIPi4NFGT1nxdMYTfhuzFLAz7rvhgGA7exyaZl30m8MRB8++++bi 5ZrjDnUH8AOioLUHPFQdIfhYddIi9RTJ/a9kSyI619VjLVegIsAEQLhxvjWDEle7cSKg nvUzVvsaV2OtMS121oTj9G+gPID1TaHnuviZ71RLo7LxBnnIqVQrn1evRHF/xNR+Tl1z +86Q==
- Archived-at: <https://zsh.org/workers/54765>
- In-reply-to: <CAGdYchsYTam9E4+h1nB2otg+5CDGki_57knH-=W+WAY6UiKGaA@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAGdYchsYTam9E4+h1nB2otg+5CDGki_57knH-=W+WAY6UiKGaA@mail.gmail.com>
On Fri, Jun 12, 2026 at 12:41 PM Philippe Altherr
<philippe.altherr@xxxxxxxxx> wrote:
>
> - Restrict named directories to scalar parameters
Aside: I suggest adding PS1="" to the input of zsh -fis for the Test/K01 patch.
I tried running the test for this without the accompanying patch to params.c.
--- expected
+++ actual
@@ -4,5 +4,5 @@
nameddirs=( v1 /A )
nameddirs=( v1 /A v2 /2 r2 /R )
nameddirs=( v1 /A r2 /R )
-nameddirs=( v1 /A r2 /R )
-nameddirs=( v1 /A v2 /B r2 /R )
+nameddirs=( v1 /A )
+nameddirs=( v1 /A v2 /B )
Running the test standalone with -fvxis, the expected result diverges here:
echo "nameddirs=( ${(kv)nameddirs} )"
+Src/zsh:13> echo 'nameddirs=( v1 /A r2 /R )'
nameddirs=( v1 /A r2 /R )
r2=v2
+Src/zsh:14> r2=v2
That's initialized the placeholder nameref r2 with the name v2. The
test asserts autonamedirs should not remove the previous forced entry
r2=/R from the named directory table, because r2 is not a plain
scalar?
If that's what you mean, then that's what the description of the patch
should be, because as far as I can tell all the other cases of "named
directory is not a scalar parameter" are handled by adduserdir(). If
you have a simple case of ~name or autonamedirs stuffing a non-scalar
into the table, please provide it.
I'm on the proverbial fence over whether the existing behavior
demonstrated by the test is in fact wrong.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author