SCCS-vsn: bin/csh/func.c 5.27
-static char sccsid[] = "@(#)func.c 5.26 (Berkeley) %G%";
+static char sccsid[] = "@(#)func.c 5.27 (Berkeley) %G%";
#endif /* not lint */
#include <sys/types.h>
#endif /* not lint */
#include <sys/types.h>
*/
zlast = T_GOTO;
for (wp = whyles; wp; wp = wp->w_next)
*/
zlast = T_GOTO;
for (wp = whyles; wp; wp = wp->w_next)
- if (wp->w_end.type == I_SEEK) {
+ if (wp->w_end.type == F_SEEK && wp->w_end.f_seek == 0) {
search(T_BREAK, 0, NULL);
btell(&wp->w_end);
}
search(T_BREAK, 0, NULL);
btell(&wp->w_end);
}
btell(&nwp->w_start);
nwp->w_fename = Strsave(cp);
nwp->w_next = whyles;
btell(&nwp->w_start);
nwp->w_fename = Strsave(cp);
nwp->w_next = whyles;
+ nwp->w_end.type = F_SEEK;
whyles = nwp;
/*
* Pre-read the loop so as to be more comprehensible to a terminal user.
whyles = nwp;
/*
* Pre-read the loop so as to be more comprehensible to a terminal user.
(struct whyle *) xcalloc(1, sizeof(*nwp));
nwp->w_start = lineloc;
(struct whyle *) xcalloc(1, sizeof(*nwp));
nwp->w_start = lineloc;
- nwp->w_end.type = I_SEEK;
+ nwp->w_end.type = F_SEEK;
+ nwp->w_end.f_seek = 0;
nwp->w_next = whyles;
whyles = nwp;
zlast = T_WHILE;
nwp->w_next = whyles;
whyles = nwp;
zlast = T_WHILE;
- if (whyles->w_end.type == I_SEEK) {
+ if (whyles->w_end.type == F_SEEK && whyles->w_end.f_seek == 0) {
search(T_BREAK, 0, NULL);
btell(&whyles->w_end);
whyles->w_end.f_seek--;
search(T_BREAK, 0, NULL);
btell(&whyles->w_end);
whyles->w_end.f_seek--;
for (; whyles; whyles = nwp) {
register struct whyle *wp = whyles;
nwp = wp->w_next;
for (; whyles; whyles = nwp) {
register struct whyle *wp = whyles;
nwp = wp->w_next;
- if (wp->w_start.type != F_SEEK || wp->w_end.type != F_SEEK)
- continue;
-
+ if (wp->w_start.type != F_SEEK || wp->w_end.type != F_SEEK)
+ break;
if (o.f_seek >= wp->w_start.f_seek &&
(wp->w_end.f_seek == 0 || o.f_seek < wp->w_end.f_seek))
break;
if (o.f_seek >= wp->w_start.f_seek &&
(wp->w_end.f_seek == 0 || o.f_seek < wp->w_end.f_seek))
break;