zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: err_exit/err_return regression
Date: Sat, 3 Oct 2015 17:26:18 -0700	[thread overview]
Message-ID: <151003172618.ZM31496@torch.brasslantern.com> (raw)
In-Reply-To: <20151001203209.GA38889@Qliphoth.local>

On Oct 1, 10:32pm, Joshua Krusell wrote:
} Subject: Re: err_exit/err_return regression
}
} On 29/09/15 at 06:09P, Bart Schaefer wrote:
} > I think what this boils down to is, "retflag" needs two values to
} > distinguish an actual return from an ERR_RETURN

I'm still not entirely happy with that patch, in case anyone has any
better ideas.  I'm tempted to check cmdstack[cmdsp-1] to see whether
it is one of CS_IF or CS_ELIF, but that's abusing the prompt mechanism
for program control, which seems wrong.

} With this patch it's still failing for me, but only when running the
} snippet I posted as a script. Seems to magically work with the sourced
} 'cut-and-paste' version.

The following seems like an obvious former thinko, in retrospect.  All
the regular tests still pass.  Anyone see a problem?

diff --git a/Src/exec.c b/Src/exec.c
index 154bbb8..235faf3 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -1364,7 +1364,8 @@ sublist_done:
 	 * we hit execcmd on the way down.  We're now
 	 * on the way back up, so don't restore it.
 	 */
-	noerrexit = (oldnoerrexit == 2) ? 0 : oldnoerrexit;
+	if (oldnoerrexit != 2)
+	    noerrexit = oldnoerrexit;
 
 	if (sigtrapped[SIGDEBUG] && !isset(DEBUGBEFORECMD) && !donedebug) {
 	    /*


  reply	other threads:[~2015-10-04  0:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-09 11:33 jsks
2015-07-09 13:38 ` Peter Stephenson
2015-09-29 15:43   ` Joshua Krusell
2015-09-29 18:54     ` Peter Stephenson
2015-09-29 20:52       ` Joshua Krusell
2015-09-30  1:09         ` Bart Schaefer
2015-10-01 20:32           ` Joshua Krusell
2015-10-04  0:26             ` Bart Schaefer [this message]
2015-10-04  2:58               ` Bart Schaefer

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=151003172618.ZM31496@torch.brasslantern.com \
    --to=schaefer@brasslantern.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).