From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11169 invoked by alias); 4 Oct 2015 00:26:23 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 36766 Received: (qmail 18373 invoked from network); 4 Oct 2015 00:26:22 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=nZrz7CacsJSu4YFtqGtT/DdfCMeSjBa9cinRL+EzHek=; b=cCwnwllNH4Ik23T1UdSzzWE46gUS+4tmnIiAUeOl5KXF6WtAHi7wkJu5oncbHMq4IK 92RITwZTEi65pUITA6Hc8npxpoxCmmsOp+h059yOD/M9sI8hd5ubevlHGZDnj4uvo2dQ o/ocQrj7ySwws1u0KtAnYu8wamwzxGutvh16OAtV2oe7pyQGuq1Hs/xHAF8AKRuO6sPu sTq3uj6g5rCb/h0sSM7R5+Gf9TBGo5jZyzz6/lyfSufarC2sVKsLqXcQdIS5z8fs1yz4 VjhFD2FbdSVbPorHDOhNDM8ieT9iAKQM8avlRVk6hLEpmhqpZQmJqvnEvQG7BAAMesZW xp3A== X-Gm-Message-State: ALoCoQkcB9N1sdf2AY2gGSxMqj2rbRAcfV2VVsZxsIpirhZdo40UgNoKgcKBb8v0FdneENR+mk9M X-Received: by 10.202.230.5 with SMTP id d5mr12764121oih.85.1443918380414; Sat, 03 Oct 2015 17:26:20 -0700 (PDT) From: Bart Schaefer Message-Id: <151003172618.ZM31496@torch.brasslantern.com> Date: Sat, 3 Oct 2015 17:26:18 -0700 In-Reply-To: <20151001203209.GA38889@Qliphoth.local> Comments: In reply to Joshua Krusell "Re: err_exit/err_return regression" (Oct 1, 10:32pm) References: <20150709143823.184fb4e1@pwslap01u.europe.root.pri> <20150929154327.GA11991@Qliphoth.local> <20150929195432.7b0e3525@ntlworld.com> <20150929205204.GA29608@Qliphoth.local> <150929180932.ZM9288@torch.brasslantern.com> <20151001203209.GA38889@Qliphoth.local> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: err_exit/err_return regression MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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) { /*