Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
fix for $? after parameter setting
- X-seq: zsh-workers 637
- From: Zefram <A.Main@xxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxxx (Z Shell workers mailing list)
- Subject: fix for $? after parameter setting
- Date: Thu, 23 Nov 1995 14:54:27 +0000 (GMT)
-----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-----
Messages sorted by:
Reverse Date,
Date,
Thread,
Author