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

Re: [PATCH] Fix crash on unset-through-nameref



2024-03-05 10:42:18 -0800, Bart Schaefer:
[...]
> Although I wasn't aware of that discussion, I had already thought of that:
> 
>   When RNAME includes an array subscript, the subscript expression is
>   interpreted at the time ${PNAME} is expanded.  Any form of subscript is
>   allowed, including those that select individual elements, substrings of
>   scalar strings, or multiple elements as with array slices or the '(i)',
>   '(I)', '(r)', '(R)' and '(w)' subscript flags.  However, the subscript
>   is evaluated with the NO_EXEC option in effect, so command substitution
>   and other similar constructs produce no output, although are not
>   syntactically excluded.
[...]

Thanks for those details. Note the double evaluation though
(where n ends up incremented twice each time in my example)
which seems to be affecting all shells except bash.

-- 
Stephane




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