diff options
| author | dsl <dsl@NetBSD.org> | 2007-01-01 21:29:01 +0000 |
|---|---|---|
| committer | dsl <dsl@NetBSD.org> | 2007-01-01 21:29:01 +0000 |
| commit | b7483eac6913ddbc5be6e00fc023ffc1baecb93b (patch) | |
| tree | 1c140b1bf4d98699324572e053e3baf55e305a5d /usr.bin/make | |
| parent | e3603e4e86c9cedfdeb1c2a8a35521fec490c451 (diff) | |
Since the 'buf' code here is only used by make, we don't need two names
for the default buffer size of 256.
Also allow for the trailing 0 byte!
Diffstat (limited to 'usr.bin/make')
| -rw-r--r-- | usr.bin/make/main.c | 8 | ||||
| -rw-r--r-- | usr.bin/make/var.c | 16 |
2 files changed, 12 insertions, 12 deletions
diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c index a4898d27111..448469c776f 100644 --- a/usr.bin/make/main.c +++ b/usr.bin/make/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.140 2006/12/16 08:59:29 dsl Exp $ */ +/* $NetBSD: main.c,v 1.141 2007/01/01 21:29:01 dsl Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,7 +69,7 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: main.c,v 1.140 2006/12/16 08:59:29 dsl Exp $"; +static char rcsid[] = "$NetBSD: main.c,v 1.141 2007/01/01 21:29:01 dsl Exp $"; #else #include <sys/cdefs.h> #ifndef lint @@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993\n\ #if 0 static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: main.c,v 1.140 2006/12/16 08:59:29 dsl Exp $"); +__RCSID("$NetBSD: main.c,v 1.141 2007/01/01 21:29:01 dsl Exp $"); #endif #endif /* not lint */ #endif @@ -1460,7 +1460,7 @@ Cmd_Exec(const char *cmd, const char **errnum) */ (void)close(fds[1]); - buf = Buf_Init(MAKE_BSIZE); + buf = Buf_Init(0); do { char result[BUFSIZ]; diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c index 0215431d1e3..127fff4387f 100644 --- a/usr.bin/make/var.c +++ b/usr.bin/make/var.c @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.115 2006/10/27 21:00:19 dsl Exp $ */ +/* $NetBSD: var.c,v 1.116 2007/01/01 21:29:01 dsl Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: var.c,v 1.115 2006/10/27 21:00:19 dsl Exp $"; +static char rcsid[] = "$NetBSD: var.c,v 1.116 2007/01/01 21:29:01 dsl Exp $"; #else #include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: var.c,v 1.115 2006/10/27 21:00:19 dsl Exp $"); +__RCSID("$NetBSD: var.c,v 1.116 2007/01/01 21:29:01 dsl Exp $"); #endif #endif /* not lint */ #endif @@ -389,7 +389,7 @@ VarFind(const char *name, GNode *ctxt, int flags) len = strlen(env); - v->val = Buf_Init(len); + v->val = Buf_Init(len + 1); Buf_AddBytes(v->val, len, (Byte *)env); v->flags = VAR_FROM_ENV; @@ -1840,7 +1840,7 @@ VarQuote(char *str) newline = Shell_GetNewline(); - buf = Buf_Init(MAKE_BSIZE); + buf = Buf_Init(0); for (; *str; str++) { if (*str == '\n' && newline != NULL) { Buf_AddBytes(buf, strlen(newline), newline); @@ -1880,7 +1880,7 @@ VarChangeCase(char *str, int upper) int (*modProc)(int); modProc = (upper ? toupper : tolower); - buf = Buf_Init(MAKE_BSIZE); + buf = Buf_Init(0); for (; *str ; str++) { Buf_AddByte(buf, (Byte)modProc(*str)); } @@ -3089,7 +3089,7 @@ Var_Parse(const char *str, GNode *ctxt, Boolean errnum, int *lengthPtr, startc = str[1]; endc = startc == PROPEN ? PRCLOSE : BRCLOSE; - buf = Buf_Init(MAKE_BSIZE); + buf = Buf_Init(0); /* * Skip to the end character or a colon, whichever comes first. @@ -3377,7 +3377,7 @@ Var_Subst(const char *var, const char *str, GNode *ctxt, Boolean undefErr) * been reported to prevent a plethora * of messages when recursing */ - buf = Buf_Init(MAKE_BSIZE); + buf = Buf_Init(0); errorReported = FALSE; trailingBslash = FALSE; |
