zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: zsh-workers@zsh.org
Subject: Re: Question about err_return
Date: Thu, 24 Aug 2017 11:33:27 +0100	[thread overview]
Message-ID: <20170824113327.2fab99b5@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <20170823210951.6c430e82@ntlworld.com>

On Wed, 23 Aug 2017 21:09:51 +0100
Peter Stephenson <p.w.stephenson@ntlworld.com> 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


      reply	other threads:[~2017-08-24 10:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-21  5:28 Radon Rosborough
2017-08-21  6:27 ` Daniel Shahaf
2017-08-23 16:56 ` Peter Stephenson
2017-08-23 20:09   ` Peter Stephenson
2017-08-24 10:33     ` Peter Stephenson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170824113327.2fab99b5@pwslap01u.europe.root.pri \
    --to=p.stephenson@samsung.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).