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

Re: Regression / err_return / arithmetic 5.4.x ?



# schaefer@xxxxxxxxxxxxxxxx / 2017-09-17 17:50:28 -0700:
> On Sep 15,  7:38pm, Bart Schaefer wrote:
> }
> } I reverted 97d4bdb and the problem disappears.  Haven't gotten any
> } further than that, yet.
> 
> Looks like just one case where use of the new bitflags was missed:
> 
> diff --git a/Src/loop.c b/Src/loop.c
> index 40e3bcb..1013aeb 100644
> --- a/Src/loop.c
> +++ b/Src/loop.c
> @@ -428,7 +428,7 @@ execwhile(Estate state, UNUSED(int do_exec))
>      } else
>          for (;;) {
>              state->pc = loop;
> -            noerrexit = 1;
> +            noerrexit = NOERREXIT_EXIT | NOERREXIT_RETURN;
>  
>  	    /* In case the test condition is a functional no-op,
>  	     * make sure signal handlers recognize ^C to end the loop. */

which zsh release has this fix?  and does it cover just arithmetic
expansion or does it fix while conditions in general?  are there any
tests for errreturn?  i'm asking because i see this with 5.4.2:

  $ cat > errreturn.zsh <<\EOF
  > function
  > {
  >   while false; do
  >     :
  >   done
  >   echo you should see this
  > }
  > echo this should come second
  > EOF

  $ zsh -fo noerrreturn errreturn.zsh
  > you should see this
  > this should come second

  $ zsh -fo errreturn errreturn.zsh
  > this should come second

-- 
roman



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