Re: [PATCH] Restrict named directories to scalar parameters set to a path

Bart Schaefer <[email protected]> Sat, 13 Jun 2026 13:28:48 -0700
Newsgroups gmane.comp.shells.zsh.devel
Message-ID <CAH+w=7ZLFZ83m=aPMf+ZjFqS4jTthenQfuRoCpQqxEhquZAV4A@mail.gmail.com>
On Fri, Jun 12, 2026 at 2:44 PM Bart Schaefer <[email protected]> wrote:
>
> On Fri, Jun 12, 2026 at 12:52 PM Philippe Altherr
> <[email protected]> wrote:
> >
> > The documentation of AUTO_NAME_DIRS states that any parameter set to an absolute path becomes a named directory but currently setting any value turns the parameter into a named directory.
>
> Could you please describe how to reproduce the "before" scenario that
> inspired this patch?

Looking at this in the context of workers/54765 (my reply to
workers/54759), the problem appears not to be that "setting any value
turns the parameter into a named directory" -- I cannot make that
happen -- but rather that assigning any value other than a path
REMOVES an existing named directory.

This seems unambiguously correct to me, in contrast to the nameref
case in 54759 which at least has the argument that initializing a
nameref is not altering a "real" parameter.

However, this does make me think that 54759 should (if the behavior is
changed at all) be a case of "is not a nameref" rather than "is a
scalar".  That is, creating an array dx after establishing a nameddir
~dx should in fact remove the nameddir.  The case where the array is a
local is already handled by workers/54328.

What have I missed?