From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5479 invoked from network); 29 Jan 1997 00:41:26 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by coral.primenet.com.au with SMTP; 29 Jan 1997 00:41:26 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id TAA04125; Tue, 28 Jan 1997 19:21:13 -0500 (EST) Resent-Date: Tue, 28 Jan 1997 19:21:13 -0500 (EST) From: Zoltan Hidvegi Message-Id: <199701282330.AAA02076@hzoli.ppp.cs.elte.hu> Subject: Re: return from function terminates loop To: daniel@UG.EDS.COM (Daniel Dignam) Date: Wed, 29 Jan 1997 00:30:18 +0100 (MET) Cc: zsh-workers@math.gatech.edu In-Reply-To: <32EE34E7.FF6@UG.EDS.COM> from Daniel Dignam at "Jan 28, 97 05:18:31 pm" X-Mailer: ELM [version 2.4ME+ PL17 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"6ajIb.0.O01.uVfxo"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/2837 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu > Returning from a function which s called from a loop appears to > terminate the loop. Consider the following: Now I know the reason for that breaks = 0 assignment in doshfunc! Try this patch. Zoltan *** Src/exec.c 1997/01/27 22:03:20 3.1.1.11 --- Src/exec.c 1997/01/28 22:54:56 *************** *** 2520,2525 **** --- 2520,2526 ---- char *s, *ou; void *xexitfn; char saveopts[OPT_SIZE]; + int obreaks = breaks; HEAPALLOC { pushheap(); *************** *** 2585,2591 **** zfree(locallist, sizeof(struct linklist)); locallist = olist; /* restore the old list of local variables */ ! retflag = 0; freearray(pparams); if (oargv0) { zsfree(argzero); --- 2586,2595 ---- zfree(locallist, sizeof(struct linklist)); locallist = olist; /* restore the old list of local variables */ ! if (retflag) { ! retflag = 0; ! breaks = obreaks; ! } freearray(pparams); if (oargv0) { zsfree(argzero);