zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@sunsite.dk
Subject: Re: command substitution: zsh waits until command exits
Date: Mon, 03 Dec 2007 20:20:09 -0800	[thread overview]
Message-ID: <071203202009.ZM5528@torch.brasslantern.com> (raw)
In-Reply-To: <071203191510.ZM5279@torch.brasslantern.com>

[> zsh-workers]

On Dec 3,  7:15pm, Bart Schaefer wrote:
} Subject: Re: command substitution: zsh waits until command exits
}
} On Dec 4,  2:42am, Vincent Lefevre wrote:
} }
} } Now, if I understand correctly,
} } 
} }   $(false) && echo true
} } 
} } shouldn't output anything because before the &&, there's no command
} } and the command substitution has a non-zero exit status.
} 
} I suspect that what's happening is that zsh is losing the exit status
} on its way from step 2 to step 4 of the expansion sequence

Is it really this easy?  There must be something I'm missing.

Index: Src/exec.c
===================================================================
RCS file: /extra/cvsroot/zsh/zsh-4.0/Src/exec.c,v
retrieving revision 1.34
diff -c -r1.34 exec.c
--- Src/exec.c	26 Nov 2007 17:38:13 -0000	1.34
+++ Src/exec.c	4 Dec 2007 04:17:17 -0000
@@ -2331,7 +2331,7 @@
 		    lastval = 0;
 		    return;
 		} else {
-		    cmdoutval = 0;
+		    cmdoutval = lastval;
 		    if (varspc)
 			addvars(state, varspc, 0);
 		    if (errflag)


       reply	other threads:[~2007-12-04  4:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20071130133943.GG5855@prunille.vinc17.org>
     [not found] ` <071130073719.ZM18090@torch.brasslantern.com>
     [not found]   ` <20071130163155.GL5855@prunille.vinc17.org>
     [not found]     ` <071130185827.ZM18402@torch.brasslantern.com>
     [not found]       ` <20071202021652.GO5855@prunille.vinc17.org>
     [not found]         ` <071201210744.ZM20044@torch.brasslantern.com>
     [not found]           ` <20071202152254.GP5855@prunille.vinc17.org>
     [not found]             ` <071202102717.ZM2757@torch.brasslantern.com>
     [not found]               ` <20071203011131.GT5855@prunille.vinc17.org>
     [not found]                 ` <071203092626.ZM4367@torch.brasslantern.com>
     [not found]                   ` <20071204014227.GE5855@prunille.vinc17.org>
     [not found]                     ` <071203191510.ZM5279@torch.brasslantern.com>
2007-12-04  4:20                       ` Bart Schaefer [this message]
2007-12-04  4:59                         ` Geoff Wing
2007-12-04  9:41                           ` Bart Schaefer
2007-12-09 23:54                         ` 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=071203202009.ZM5528@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@sunsite.dk \
    /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).