From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19838 invoked from network); 28 Feb 1997 16:37:03 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by coral.primenet.com.au with SMTP; 28 Feb 1997 16:37:03 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id LAA13074; Fri, 28 Feb 1997 11:30:04 -0500 (EST) Resent-Date: Fri, 28 Feb 1997 11:30:04 -0500 (EST) From: (Zoltan T. Hidvegi) Message-Id: <9702281623.AA15725@lotto.fishkill.ibm.com> Subject: Re: case $? fails In-Reply-To: <970228082002.ZM22732@candle.brasslantern.com> from Bart Schaefer at "Feb 28, 97 08:20:02 am" To: zsh-workers@math.gatech.edu (Zsh workers list) Date: Fri, 28 Feb 1997 11:23:35 -0500 (EST) X-Mailer: ELM [version 2.4ME+ PL31 (25)] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"K7hGE.0.DC3.CWm5p"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/2946 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Bart Schaefer wrote: > } prints zero. The patch below fixes these. The for syntax is new in > } zsh-3.1 so the first two hunks should be removed if the patch is applied > } against zsh-3.0.3-test4. > > The first two hunks? Or the second two hunks? > > I've now tried this a couple of different ways and can't get it to apply > to 3.0.3-test4. Could you send a patch specifically for that? It applied cleanly for me after removing the first two hunks. But here is the patch for 3.0.3-test4 anyway. Zoltan *** loop.c 1996/12/29 01:47:11 3.0.2.1 --- loop.c 1997/02/28 16:16:48 *************** *** 168,178 **** olderrexit = noerrexit; node = cmd->u.whilecmd; ! lastval = 0; pushheap(); loops++; for (;;) { - oldval = lastval; list = (List) dupstruct(node->cont); noerrexit = 1; execlist(list, 1, 0); --- 168,177 ---- olderrexit = noerrexit; node = cmd->u.whilecmd; ! oldval = 0; pushheap(); loops++; for (;;) { list = (List) dupstruct(node->cont); noerrexit = 1; execlist(list, 1, 0); *************** *** 196,201 **** --- 195,201 ---- lastval = 1; break; } + oldval = lastval; } popheap(); loops--; *************** *** 282,291 **** l = node->lists; p = node->pats; - lastval = 0; word = *p++; singsub(&word); untokenize(word); if (node) { while (*p) { --- 282,291 ---- l = node->lists; p = node->pats; word = *p++; singsub(&word); untokenize(word); + lastval = 0; if (node) { while (*p) {