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

Re: Inconsistent behavior of ERR_EXIT with conditionals



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