Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: return from function terminates loop
- X-seq: zsh-workers 2841
- From: Daniel Dignam <daniel@xxxxxxxxxx>
- To: Zoltan Hidvegi <hzoli@xxxxxxxxxx>
- Subject: Re: return from function terminates loop
- Date: Wed, 29 Jan 1997 13:43:04 +0000
- Cc: zsh-workers@xxxxxxxxxxxxxxx
- Organization: EDS Unigraphics, Cambridge, England
- References: <199701282330.AAA02076@xxxxxxxxxxxxxxxxxxxx>
- Sender: daniel@xxxxxxxxxxxxxx
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@xxxxxxxxx
Assemblies Development Phone: +44 1223-371591
EDS Unigraphics FAX: +44 1223-316931
http://www-sdl.ug.eds.com/ug_assemblies.html
Messages sorted by:
Reverse Date,
Date,
Thread,
Author