=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/make/for.c,v retrieving revision 1.9 retrieving revision 1.10 diff -c -r1.9 -r1.10 *** src/usr.bin/make/for.c 1999/12/16 16:41:41 1.9 --- src/usr.bin/make/for.c 1999/12/16 17:02:45 1.10 *************** *** 1,4 **** ! /* $OpenBSD: for.c,v 1.9 1999/12/16 16:41:41 espie Exp $ */ /* $NetBSD: for.c,v 1.4 1996/11/06 17:59:05 christos Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: for.c,v 1.10 1999/12/16 17:02:45 espie Exp $ */ /* $NetBSD: for.c,v 1.4 1996/11/06 17:59:05 christos Exp $ */ /* *************** *** 65,71 **** #if 0 static char sccsid[] = "@(#)for.c 8.1 (Berkeley) 6/6/93"; #else ! static char rcsid[] = "$OpenBSD: for.c,v 1.9 1999/12/16 16:41:41 espie Exp $"; #endif #endif /* not lint */ --- 65,71 ---- #if 0 static char sccsid[] = "@(#)for.c 8.1 (Berkeley) 6/6/93"; #else ! static char rcsid[] = "$OpenBSD: for.c,v 1.10 1999/12/16 17:02:45 espie Exp $"; #endif #endif /* not lint */ *************** *** 101,107 **** 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 */ --- 101,107 ---- 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 */ *************** *** 219,225 **** build_words_list(forLst, sub); free(sub); forLineno = Parse_Getlineno(); ! forBuf = Buf_Init(0); forLevel++; return 1; } --- 219,225 ---- build_words_list(forLst, sub); free(sub); forLineno = Parse_Getlineno(); ! Buf_Init(&forBuf, 0); forLevel++; return 1; } *************** *** 246,253 **** } if (forLevel != 0) { ! Buf_AddString(forBuf, line); ! Buf_AddChar(forBuf, '\n'); return 1; } else { --- 246,253 ---- } if (forLevel != 0) { ! Buf_AddString(&forBuf, line); ! Buf_AddChar(&forBuf, '\n'); return 1; } else { *************** *** 304,322 **** { For arg; ! if (forVar == NULL || forBuf == NULL || forLst == NULL) return; arg.var = forVar; ! arg.buf = forBuf; arg.lst = forLst; arg.lineno = forLineno; forVar = NULL; - forBuf = NULL; forLst = NULL; Lst_ForEach(arg.lst, ForExec, (ClientData) &arg); free((Address)arg.var); Lst_Destroy(arg.lst, (void (*) __P((ClientData))) free); ! Buf_Destroy(arg.buf, TRUE); } --- 304,321 ---- { For arg; ! if (forVar == NULL || forLst == NULL) return; arg.var = forVar; ! arg.buf = &forBuf; arg.lst = forLst; arg.lineno = forLineno; forVar = NULL; forLst = NULL; Lst_ForEach(arg.lst, ForExec, (ClientData) &arg); free((Address)arg.var); Lst_Destroy(arg.lst, (void (*) __P((ClientData))) free); ! Buf_Destroy(arg.buf); }