=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/make/var.c,v retrieving revision 1.9 retrieving revision 1.10 diff -c -r1.9 -r1.10 *** src/usr.bin/make/var.c 1998/07/23 18:49:05 1.9 --- src/usr.bin/make/var.c 1998/12/05 00:06:29 1.10 *************** *** 1,4 **** ! /* $OpenBSD: var.c,v 1.9 1998/07/23 18:49:05 deraadt Exp $ */ /* $NetBSD: var.c,v 1.18 1997/03/18 19:24:46 christos Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: var.c,v 1.10 1998/12/05 00:06:29 espie Exp $ */ /* $NetBSD: var.c,v 1.18 1997/03/18 19:24:46 christos Exp $ */ /* *************** *** 43,49 **** #if 0 static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94"; #else ! static char rcsid[] = "$OpenBSD: var.c,v 1.9 1998/07/23 18:49:05 deraadt Exp $"; #endif #endif /* not lint */ --- 43,49 ---- #if 0 static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94"; #else ! static char rcsid[] = "$OpenBSD: var.c,v 1.10 1998/12/05 00:06:29 espie Exp $"; #endif #endif /* not lint */ *************** *** 1236,1252 **** Boolean addSpace; /* TRUE if need to add a space to the * buffer before adding the trimmed * word */ ! char **av; /* word list [first word does not count] */ int ac, i; buf = Buf_Init (0); addSpace = FALSE; ! av = brk_string(str, &ac, FALSE); ! for (i = 1; i < ac; i++) addSpace = (*modProc)(av[i], addSpace, buf, datum); Buf_AddByte (buf, '\0'); str = (char *)Buf_GetAll (buf, (int *)NULL); Buf_Destroy (buf, FALSE); --- 1236,1255 ---- Boolean addSpace; /* TRUE if need to add a space to the * buffer before adding the trimmed * word */ ! char **av; /* word list */ ! char *as; /* word list memory */ int ac, i; buf = Buf_Init (0); addSpace = FALSE; ! av = brk_string(str, &ac, FALSE, &as); ! for (i = 0; i < ac; i++) addSpace = (*modProc)(av[i], addSpace, buf, datum); + free(as); + free(av); Buf_AddByte (buf, '\0'); str = (char *)Buf_GetAll (buf, (int *)NULL); Buf_Destroy (buf, FALSE); *************** *** 1261,1267 **** * uninterpreted) and 2) unescaped $'s that aren't before * the delimiter (expand the variable substitution). * Return the expanded string or NULL if the delimiter was missing ! * If pattern is specified, handle escaped ampersants, and replace * unescaped ampersands with the lhs of the pattern. * * Results: --- 1264,1270 ---- * uninterpreted) and 2) unescaped $'s that aren't before * the delimiter (expand the variable substitution). * Return the expanded string or NULL if the delimiter was missing ! * If pattern is specified, handle escaped ampersands, and replace * unescaped ampersands with the lhs of the pattern. * * Results: