On Sat, Dec 08, 2018 at 03:45:11PM +0000, Harald van Dijk wrote:
>
> --- a/src/eval.c
> +++ b/src/eval.c
> @@ -116,10 +116,7 @@ INCLUDE "eval.h"
>  EXITRESET {
>       evalskip = 0;
>       loopnest = 0;
> -     if (savestatus >= 0) {
> -             exitstatus = savestatus;
> -             savestatus = -1;
> -     }
> +     savestatus = -1;
>  }
>  #endif

The reason this is needed is to support a naked return.  With
your patch a naked return would either have to always return the
saved status or the new status.  Neither of which is what we
want.

Please refer to

commit 70c16dd30d4cf824aa895e9f6c095fec741c65a8
Author: Herbert Xu <[email protected]>
Date:   Mon Oct 6 21:51:26 2014 +0800

    [BUILTIN] Return without arguments in a trap should use status outside traps

Thanks,
-- 
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Reply via email to