zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@zsh.org
Subject: Re: zsh syntax check fails on correct if [[ usage (rhbz 966911)
Date: Fri, 18 Oct 2013 20:12:28 +0100	[thread overview]
Message-ID: <20131018201228.7b29ff4a@pws-pc.ntlworld.com> (raw)
In-Reply-To: <20131018163336.5b9beef3@pwslap01u.europe.root.pri>

On Fri, 18 Oct 2013 16:33:36 +0100
Peter Stephenson <p.stephenson@samsung.com> 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 <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


  reply	other threads:[~2013-10-18 19:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-18 14:02 Filip Krska
2013-10-18 15:33 ` Peter Stephenson
2013-10-18 19:12   ` Peter Stephenson [this message]
2013-10-18 15:48 ` Bart Schaefer
2013-10-18 15:56   ` Peter Stephenson
2013-10-18 19:20     ` Bart Schaefer
2013-10-18 22:43       ` Peter Stephenson
2013-10-19 21:19         ` Bart Schaefer
2013-10-19 21:46           ` Bart Schaefer
2013-10-19 21:56           ` Peter Stephenson
2013-11-20 14:08             ` Filip Krska
2013-10-18 19:29   ` Peter Stephenson

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=20131018201228.7b29ff4a@pws-pc.ntlworld.com \
    --to=p.w.stephenson@ntlworld.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).