zsh-workers
 help / color / mirror / code / Atom feed
From: Zefram <A.Main@dcs.warwick.ac.uk>
To: zsh-workers@math.gatech.edu (Z Shell workers mailing list)
Subject: fix for $? after parameter setting
Date: Thu, 23 Nov 1995 14:54:27 +0000 (GMT)	[thread overview]
Message-ID: <5898.199511231454@stone.dcs.warwick.ac.uk> (raw)

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


                 reply	other threads:[~1995-11-23 15:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=5898.199511231454@stone.dcs.warwick.ac.uk \
    --to=a.main@dcs.warwick.ac.uk \
    --cc=zsh-workers@math.gatech.edu \
    /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).