From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27423 invoked from network); 29 Jan 1997 13:56:41 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by coral.primenet.com.au with SMTP; 29 Jan 1997 13:56:41 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id IAA20385; Wed, 29 Jan 1997 08:42:10 -0500 (EST) Resent-Date: Wed, 29 Jan 1997 08:42:10 -0500 (EST) Date: Wed, 29 Jan 1997 13:43:04 +0000 From: Daniel Dignam Subject: Re: return from function terminates loop Sender: daniel@SDL.UG.EDS.COM To: Zoltan Hidvegi Cc: zsh-workers@math.gatech.edu Message-id: <32EF53E8.3F54@UG.EDS.COM> Organization: EDS Unigraphics, Cambridge, England MIME-version: 1.0 X-Mailer: Mozilla 3.01 (X11; I; OSF1 V4.0 alpha) Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit References: <199701282330.AAA02076@hzoli.ppp.cs.elte.hu> Resent-Message-ID: <"WAuRR3.0.S-4.oErxo"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/2841 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Works like a charm, thanks > > 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); -- Daniel Dignam, mailto:daniel@edsug.com Assemblies Development Phone: +44 1223-371591 EDS Unigraphics FAX: +44 1223-316931 http://www-sdl.ug.eds.com/ug_assemblies.html