diff options
| author | dsl <dsl@NetBSD.org> | 2007-10-12 22:49:36 +0000 |
|---|---|---|
| committer | dsl <dsl@NetBSD.org> | 2007-10-12 22:49:36 +0000 |
| commit | bb4beef60406f5e43d2deaf55ccea8c1df26e57f (patch) | |
| tree | 4e8537c8742630fed1737ce3bec1046a682cf7ac /usr.bin/make | |
| parent | 215593ad6c4d0d010890ad4a6ac796d0999cf260 (diff) | |
Var_Subst() seems to write into its input string! So we do need a copy.
Diffstat (limited to 'usr.bin/make')
| -rw-r--r-- | usr.bin/make/job.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/make/job.c b/usr.bin/make/job.c index 884d8324b09..4c952b7f501 100644 --- a/usr.bin/make/job.c +++ b/usr.bin/make/job.c @@ -1,4 +1,4 @@ -/* $NetBSD: job.c,v 1.128 2007/10/12 21:47:25 dsl Exp $ */ +/* $NetBSD: job.c,v 1.129 2007/10/12 22:49:36 dsl Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: job.c,v 1.128 2007/10/12 21:47:25 dsl Exp $"; +static char rcsid[] = "$NetBSD: job.c,v 1.129 2007/10/12 22:49:36 dsl Exp $"; #else #include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: job.c,v 1.128 2007/10/12 21:47:25 dsl Exp $"); +__RCSID("$NetBSD: job.c,v 1.129 2007/10/12 22:49:36 dsl Exp $"); #endif #endif /* not lint */ #endif @@ -2063,6 +2063,7 @@ Shell_GetNewline(void) void Job_SetPrefix(void) { + char job_prefix[] = "${" MAKE_JOB_PREFIX "}"; if (targPrefix) { free(targPrefix); @@ -2070,7 +2071,7 @@ Job_SetPrefix(void) Var_Set(MAKE_JOB_PREFIX, "---", VAR_GLOBAL, 0); } - targPrefix = Var_Subst(NULL, "${" MAKE_JOB_PREFIX "}", VAR_GLOBAL, 0); + targPrefix = Var_Subst(NULL, job_prefix, VAR_GLOBAL, 0); } /*- |
