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

Re: New problem with ERR_RETURN ?



> On 07/12/2022 16:17 Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> After zsh-workers 51001, 51071, 51076 (Philippe A.)
> 
> This seems wrong:
> 
> % setopt errreturn
> % f() {
>     while return 5
>     do
>         echo fail while1
>         break
>     done
> }
> % f ; echo $?
> %
> 
> Note that "echo $?" was not executed when it appears in the same
> command line as "f".

I haven't had a chance to look but I'm guessing this is something
along the lines of not properly restoring the "breaks" variable when
we return from the function, or some equivalent lack of care
with "retflags".

pws




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