Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: "break" and functions
- X-seq: zsh-workers 52848
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: "break" and functions
- Date: Fri, 29 Mar 2024 09:56:04 -0700
- Archived-at: <https://zsh.org/workers/52848>
- In-reply-to: <CAH+w=7Zi9yfc1EFEivjf9COde0UsvRbynNNu1_f5gVZyomCc3w@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAH+w=7bb9BKUCvqCb=A-Qw36+HVn-NszP2DfQeXsYmKs-HVWFg@mail.gmail.com> <CAHYJk3QZmz0v1Vc3PxfAOGz=Tj-2MFQAO4Hj969kO1QXXpq6Pw@mail.gmail.com> <CAH+w=7Zi9yfc1EFEivjf9COde0UsvRbynNNu1_f5gVZyomCc3w@mail.gmail.com>
On Fri, Mar 29, 2024 at 9:28 AM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> I meant specifically the difference in behavior
> between builtin and function
Found it: 52151, Bug: function calls with break in preexec
In exactly this same context, in fact: Adding nofork tests. No one
responded, that time.
On Sat, Sep 16, 2023 at 8:08 AM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> [...] "set -x" shows the function call being made, but it
> immediately stops without executing any commands.
>
> One of these cases has to be wrong: Either the loop should break
> immediately, so neither the builtin nor the function runs, or the
> function should run and then the loop should break. Or more
> radically, a break occurring in the argument expansions should just be
> discarded, but that seems wrong too. I think it's the former: The
> builtin shouldn't run in this case.
I suspect this comes down to "breaks" being tested at the top of
execpline2(), which is called when entering a function but not when
already committed to running a builtin.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author