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

Re: Question about err_return



On Wed, 23 Aug 2017 21:09:51 +0100
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx> wrote:
> diff --git a/Src/init.c b/Src/init.c
> index d8c26ac..9331b03 100644
> --- a/Src/init.c
> +++ b/Src/init.c
> @@ -1070,7 +1070,7 @@ setupvals(char *cmd, char *runscript, char *zsh_name)
>      sfcontext = SFC_NONE;
>      trap_return = 0;
>      trap_state = TRAP_STATE_INACTIVE;
> -    noerrexit = -1;
> +    noerrexit = NOERREXIT_SIGNAL;
>      nohistsave = 1;
>      dirstack = znewlinklist();
>      bufstack = znewlinklist();
> @@ -1199,7 +1199,7 @@ init_signals(void)
>  void
>  run_init_scripts(void)
>  {
> -    noerrexit = -1;
> +    noerrexit = NOERREXIT_SIGNAL;
>  
>      if (EMULATION(EMULATE_KSH|EMULATE_SH)) {
>  	if (islogin)

I think the two assignments modified here need the standard flags as
well since the intention is obviously to suppress error exit/return
generally in startup files (not just modify the ^C behaviour, which is
what the flag there at the moment does).

Obviously err_return in functions called from initialisation files
would get the new behaviour.  That's probably sensible if your
functions are designed to operate with the option.  It's a little
less obvious with anonymous functions, perhaps.

Apart from that, I hope this isn't going to be problematic...

pws



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