summaryrefslogtreecommitdiff
path: root/usr.bin/make
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>1999-06-06 21:16:23 +0000
committerchristos <christos@NetBSD.org>1999-06-06 21:16:23 +0000
commiteee5bfa70db3ab2e773c46c98f4fdaad2df5f2a9 (patch)
tree8e4c83df777f87b67477e764c4a3fdc3b282cdd7 /usr.bin/make
parent6c4ae8ffb4bf3c2f9b544259cfb5fec9a0789c4f (diff)
Revert previous change. I am a bonehead.
Diffstat (limited to 'usr.bin/make')
-rw-r--r--usr.bin/make/var.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c
index c20a61ae65e..9c992c10293 100644
--- a/usr.bin/make/var.c
+++ b/usr.bin/make/var.c
@@ -1,4 +1,4 @@
-/* $NetBSD: var.c,v 1.33 1999/06/06 20:41:04 christos Exp $ */
+/* $NetBSD: var.c,v 1.34 1999/06/06 21:16:23 christos Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -39,14 +39,14 @@
*/
#ifdef MAKE_BOOTSTRAP
-static char rcsid[] = "$NetBSD: var.c,v 1.33 1999/06/06 20:41:04 christos Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.34 1999/06/06 21:16:23 christos 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.33 1999/06/06 20:41:04 christos Exp $");
+__RCSID("$NetBSD: var.c,v 1.34 1999/06/06 21:16:23 christos Exp $");
#endif
#endif /* not lint */
#endif
@@ -2137,10 +2137,14 @@ Var_Parse (str, ctxt, err, lengthPtr, freePtr)
*freePtr = FALSE;
Buf_Destroy(v->val, TRUE);
free((Address)v);
- str = emalloc(*lengthPtr + 1);
- strncpy(str, start, *lengthPtr);
- str[*lengthPtr] = '\0';
- *freePtr = TRUE;
+ if (dynamic) {
+ str = emalloc(*lengthPtr + 1);
+ strncpy(str, start, *lengthPtr);
+ str[*lengthPtr] = '\0';
+ *freePtr = TRUE;
+ } else {
+ str = var_Error;
+ }
}
return (str);