Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Inconsistent behavior of ERR_EXIT with conditionals
- X-seq: zsh-workers 50896
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Philippe Altherr <philippe.altherr@xxxxxxxxx>
- Cc: zsh-workers@xxxxxxx
- Subject: Re: Inconsistent behavior of ERR_EXIT with conditionals
- Date: Sun, 6 Nov 2022 19:50:04 -0800
- Archived-at: <https://zsh.org/workers/50896>
- In-reply-to: <CAH+w=7ZTSXUm6DLDk9k7z_V7YezKXJdcPi2uw1bTdmMjvTbkzg@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAGdYchsbWpFRsxS2CRzhdDix-B9osY_isv9nuBjbvt4nDTEWLA@mail.gmail.com> <CAH+w=7ZTSXUm6DLDk9k7z_V7YezKXJdcPi2uw1bTdmMjvTbkzg@mail.gmail.com>
On Sun, Nov 6, 2022 at 12:45 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> [...] I suspect this fix may be needed elsewhere ... there are a
> bunch of similar cases for multi-line shell constructs in Src/loop.c
Those are:
for
select
while
repeat
if
case
Does anyone disagree that Philippe's examples demonstrate that "if"
and "case" should get this treatment?
More questionable are the looping constructs. I can't come up with a
way to have the loop end in an error state without the whole shell
ERREXITing before reaching the end of the loop body. The value of
this_noerrexit matters at all, as far as I can tell, only to suppress
the false-condition that ends a "while" loop, and is meaningless in
for/select/repeat?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author