Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Fix crash on unset-through-nameref
- X-seq: zsh-workers 52687
- From: Stephane Chazelas <stephane@xxxxxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: [PATCH] Fix crash on unset-through-nameref
- Date: Tue, 5 Mar 2024 19:51:33 +0000
- Archived-at: <https://zsh.org/workers/52687>
- In-reply-to: <CAH+w=7bJsoJcDz0aNr9G11On4a_fssw3QJHTrtzQnT75n8A-Hw@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- Mail-followup-to: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, Zsh hackers list <zsh-workers@xxxxxxx>
- References: <CAH+w=7ayqWoufueuaHiCzjmzgHtv6VV0m7mEXoHn5nGq4pNOzg@mail.gmail.com> <20240304062914.kn6wquvgog3lefom@chazelas.org> <CAH+w=7b9dcQ4f=71rFZSWBVEJ4bzj7NxzD2-zoj2TkpaCkaCjw@mail.gmail.com> <20240304193409.lv725ah6eifiazzx@chazelas.org> <CAH+w=7ZiTe_hPoBRtHBsRHRvifkiaCJPOCzRSpz0H=XHV8rNbw@mail.gmail.com> <20240305081859.r3qwiyduk2wgkdby@chazelas.org> <CAH+w=7bJsoJcDz0aNr9G11On4a_fssw3QJHTrtzQnT75n8A-Hw@mail.gmail.com>
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