* fix for $? after parameter setting
@ 1995-11-23 14:54 Zefram
0 siblings, 0 replies; only message in thread
From: Zefram @ 1995-11-23 14:54 UTC (permalink / raw)
To: Z Shell workers mailing list
-----BEGIN PGP SIGNED MESSAGE-----
This bug appeared in beta10:
% wibble=$(false)
% echo $?
0
% ksh
$ wibble=$(false)
$ echo $?
1
Here's the fix:
*** 1.1 1995/11/23 06:07:30
--- Src/exec.c 1995/11/23 14:48:19
***************
*** 1161,1168 ****
} else
addlinknode(args, dupstring(nullcmd));
} else {
addvars(cmd->vars, 0);
! lastval = errflag;
if (isset(XTRACE)) {
fputc('\n', stderr);
fflush(stderr);
--- 1161,1169 ----
} else
addlinknode(args, dupstring(nullcmd));
} else {
+ lastval = 0;
addvars(cmd->vars, 0);
! if(errflag) lastval = errflag;
if (isset(XTRACE)) {
fputc('\n', stderr);
fflush(stderr);
-zefram
-----BEGIN PGP SIGNATURE-----
Version: 2.6.i
iQCVAgUBMLSLEnD/+HJTpU/hAQG2RAP+Khs6U2zLscA3ubRQqhxUBJi+lqZLBCb0
eNA6DrmhpbKSGSCDNUrt2ge+S6/0gp8Hls/vcjf4GafDwf62X1B4fykc37n520rp
/RMbXdVsRBlG74R+nPlMeKTHU0wtqfkKkxm4rkVpBDov8KMVz7h+oI6nQys+JyDL
z2sqXdXbCw8=
=osYx
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1995-11-23 15:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-11-23 14:54 fix for $? after parameter setting Zefram
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).