From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1575 invoked by alias); 18 Oct 2013 19:12:39 -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: 31844 Received: (qmail 416 invoked from network); 18 Oct 2013 19:12:33 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=vFfRWheH8PmUWEo7cIdpeNMndvoKJXG1Ke0ayuHS6j0=; b=VXQHi67qL4sQAG5qtmHZ0VbqSBd50rcfTGW26xT9g4P6RKgFlzg256BXdqcJnYcoy4 WHt/V0TmNczgSzdMU0AM+MDMT1NS0+9HPUovbtr2mhSzw1q0uveHTzZMJR3TRvcYUhIo Il4PeOGZe3HqVfZywXfu9NoQb3tUaj0UUIePt1B7GLyWC1ygwyMIa75u/5Ngm4+01v1u dugZRkUhALC4niITTviQr5ZYfdLSs6pI5rrThSuVXrCuXDP4ANTCEjG47Nl0GJ7Y/qhn MjBmVAfjjrqwUshISag46p79j11JgnfDqYLY73xy/Vlazi1TS53Hsno4EAtVLA+ttoOF 9qJQ== X-Gm-Message-State: ALoCoQnfHaP137tie/FM8DhS4eeK9ZEi/7dQb+DapESu8g9Jqf4RR7VyBbEcJuSdfh4/IPPZQ7u6 X-Received: by 10.14.149.14 with SMTP id w14mr78475eej.107.1382123550468; Fri, 18 Oct 2013 12:12:30 -0700 (PDT) X-ProxyUser-IP: 86.6.157.246 Date: Fri, 18 Oct 2013 20:12:28 +0100 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: zsh syntax check fails on correct if [[ usage (rhbz 966911) Message-ID: <20131018201228.7b29ff4a@pws-pc.ntlworld.com> In-Reply-To: <20131018163336.5b9beef3@pwslap01u.europe.root.pri> References: <52613F82.1000009@redhat.com> <20131018163336.5b9beef3@pwslap01u.europe.root.pri> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.7; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 18 Oct 2013 16:33:36 +0100 Peter Stephenson wrote: > It looks like when $(...) doesn't run anything > because of NO_EXEC it's keeping the status value from the parent shell, > which isn't useful. (That's where the test above comes into the problem > --- it's setting the internal status to 1.) I think we need to > initialise the status to 0 after the fork. No, that's not right, and there's a check for it in D08cmdsubst.ztst. false echo `echo $?` 0:Non-empty command substitution inherits status >1 We *do* need to inherit the status. To go down this route we'd need to detect that nothing was being executed and set the status explicitly to zero, which we do in some cases, but not for NOEXEC. -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/