zsh-workers
 help / color / mirror / code / Atom feed
* Re: command substitution: zsh waits until command exits
       [not found]                     ` <071203191510.ZM5279@torch.brasslantern.com>
@ 2007-12-04  4:20                       ` Bart Schaefer
  2007-12-04  4:59                         ` Geoff Wing
  2007-12-09 23:54                         ` Bart Schaefer
  0 siblings, 2 replies; 4+ messages in thread
From: Bart Schaefer @ 2007-12-04  4:20 UTC (permalink / raw)
  To: zsh-workers

[> 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)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: command substitution: zsh waits until command exits
  2007-12-04  4:20                       ` command substitution: zsh waits until command exits Bart Schaefer
@ 2007-12-04  4:59                         ` Geoff Wing
  2007-12-04  9:41                           ` Bart Schaefer
  2007-12-09 23:54                         ` Bart Schaefer
  1 sibling, 1 reply; 4+ messages in thread
From: Geoff Wing @ 2007-12-04  4:59 UTC (permalink / raw)
  To: Zsh Hackers

On Tuesday 2007-12-04 15:20 +1100, Bart Schaefer output:
:[> zsh-workers]
:Is it really this easy?  There must be something I'm missing.

Seems to have come in in zsh-2.6-beta16-2.6-beta17.diff (May 1996).
There's insufficient information to (quickly) determine what inspired
that choice back then.

Regards,
Geoff


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: command substitution: zsh waits until command exits
  2007-12-04  4:59                         ` Geoff Wing
@ 2007-12-04  9:41                           ` Bart Schaefer
  0 siblings, 0 replies; 4+ messages in thread
From: Bart Schaefer @ 2007-12-04  9:41 UTC (permalink / raw)
  To: Zsh Hackers

On Dec 4,  3:59pm, Geoff Wing wrote:
} Subject: Re: command substitution: zsh waits until command exits
}
} On Tuesday 2007-12-04 15:20 +1100, Bart Schaefer output:
} :[> zsh-workers]
} :Is it really this easy?  There must be something I'm missing.
} 
} Seems to have come in in zsh-2.6-beta16-2.6-beta17.diff (May 1996).
} There's insufficient information to (quickly) determine what inspired
} that choice back then.

That's from the period during which I don't have my own archives ...
but beta17 appears to have come from hzoli-14 (wow, I'd forgotten
about all those not-quite-official "releases").


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: command substitution: zsh waits until command exits
  2007-12-04  4:20                       ` command substitution: zsh waits until command exits Bart Schaefer
  2007-12-04  4:59                         ` Geoff Wing
@ 2007-12-09 23:54                         ` Bart Schaefer
  1 sibling, 0 replies; 4+ messages in thread
From: Bart Schaefer @ 2007-12-09 23:54 UTC (permalink / raw)
  To: zsh-workers

On Dec 3,  8:20pm, Bart Schaefer wrote:
}
} Is it really this easy?  There must be something I'm missing.

No one seemed to think I missed anything, so I've committed this along
with a couple of tests.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-12-09 23:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [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                       ` command substitution: zsh waits until command exits Bart Schaefer
2007-12-04  4:59                         ` Geoff Wing
2007-12-04  9:41                           ` Bart Schaefer
2007-12-09 23:54                         ` Bart Schaefer

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).