=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/make/for.c,v retrieving revision 1.4 retrieving revision 1.5 diff -c -r1.4 -r1.5 *** src/usr.bin/make/for.c 1998/12/05 00:06:27 1.4 --- src/usr.bin/make/for.c 1999/11/11 11:42:19 1.5 *************** *** 1,4 **** ! /* $OpenBSD: for.c,v 1.4 1998/12/05 00:06:27 espie Exp $ */ /* $NetBSD: for.c,v 1.4 1996/11/06 17:59:05 christos Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: for.c,v 1.5 1999/11/11 11:42:19 espie Exp $ */ /* $NetBSD: for.c,v 1.4 1996/11/06 17:59:05 christos Exp $ */ /* *************** *** 38,44 **** #if 0 static char sccsid[] = "@(#)for.c 8.1 (Berkeley) 6/6/93"; #else ! static char rcsid[] = "$OpenBSD: for.c,v 1.4 1998/12/05 00:06:27 espie Exp $"; #endif #endif /* not lint */ --- 38,44 ---- #if 0 static char sccsid[] = "@(#)for.c 8.1 (Berkeley) 6/6/93"; #else ! static char rcsid[] = "$OpenBSD: for.c,v 1.5 1999/11/11 11:42:19 espie Exp $"; #endif #endif /* not lint */ *************** *** 72,89 **** * then we evaluate the for loop for each variable in the varlist. */ ! static int forLevel = 0; /* Nesting level */ ! static char *forVar; /* Iteration variable */ ! static Buffer forBuf; /* Commands in loop */ ! static Lst forLst; /* List of items */ /* * State of a for loop. */ typedef struct _For { ! Buffer buf; /* Unexpanded buffer */ ! char* var; /* Index name */ ! Lst lst; /* List of variables */ } For; static int ForExec __P((ClientData, ClientData)); --- 72,91 ---- * then we evaluate the for loop for each variable in the varlist. */ ! static int forLevel = 0; /* Nesting level */ ! static char *forVar; /* Iteration variable */ ! static Buffer forBuf; /* Commands in loop */ ! static Lst forLst; /* List of items */ ! static unsigned long forLineno; /* Line at beginning of loop */ /* * State of a for loop. */ typedef struct _For { ! Buffer buf; /* Unexpanded buffer */ ! char* var; /* Index name */ ! Lst lst; /* List of variables */ ! unsigned long lineno; } For; static int ForExec __P((ClientData, ClientData)); *************** *** 175,180 **** --- 177,183 ---- * Make a list with the remaining words */ forLst = Lst_Init(FALSE); + forLineno = Parse_Getlineno(); buf = Buf_Init(0); sub = Var_Subst(NULL, ptr, VAR_GLOBAL, FALSE); *************** *** 264,270 **** if (DEBUG(FOR)) (void) fprintf(stderr, "--- %s = %s\n", arg->var, name); Parse_FromString(Var_Subst(arg->var, (char *) Buf_GetAll(arg->buf, &len), ! VAR_GLOBAL, FALSE)); Var_Delete(arg->var, VAR_GLOBAL); return 0; --- 267,273 ---- if (DEBUG(FOR)) (void) fprintf(stderr, "--- %s = %s\n", arg->var, name); Parse_FromString(Var_Subst(arg->var, (char *) Buf_GetAll(arg->buf, &len), ! VAR_GLOBAL, FALSE), arg->lineno); Var_Delete(arg->var, VAR_GLOBAL); return 0; *************** *** 294,299 **** --- 297,303 ---- arg.var = forVar; arg.buf = forBuf; arg.lst = forLst; + arg.lineno = forLineno; forVar = NULL; forBuf = NULL; forLst = NULL;