summaryrefslogtreecommitdiff
path: root/usr.bin/make
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/make')
-rw-r--r--usr.bin/make/arch.c19
-rw-r--r--usr.bin/make/compat.c24
-rw-r--r--usr.bin/make/cond.c11
-rw-r--r--usr.bin/make/extern.h4
-rw-r--r--usr.bin/make/job.c8
-rw-r--r--usr.bin/make/main.c20
-rw-r--r--usr.bin/make/make.c23
-rw-r--r--usr.bin/make/suff.c8
-rw-r--r--usr.bin/make/var.c8
9 files changed, 43 insertions, 82 deletions
diff --git a/usr.bin/make/arch.c b/usr.bin/make/arch.c
index af3d90f1705..7504147f54e 100644
--- a/usr.bin/make/arch.c
+++ b/usr.bin/make/arch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: arch.c,v 1.16 1999/10/05 22:06:23 espie Exp $ */
+/* $OpenBSD: arch.c,v 1.17 1999/12/06 22:28:43 espie Exp $ */
/* $NetBSD: arch.c,v 1.17 1996/11/06 17:58:59 christos Exp $ */
/*
@@ -43,7 +43,7 @@
#if 0
static char sccsid[] = "@(#)arch.c 8.2 (Berkeley) 1/2/94";
#else
-static char rcsid[] = "$OpenBSD: arch.c,v 1.16 1999/10/05 22:06:23 espie Exp $";
+static char rcsid[] = "$OpenBSD: arch.c,v 1.17 1999/12/06 22:28:43 espie Exp $";
#endif
#endif /* not lint */
@@ -941,13 +941,10 @@ Arch_Touch (gn)
{
FILE * arch; /* Stream open to archive, positioned properly */
struct ar_hdr arh; /* Current header describing member */
- char *p1, *p2;
- arch = ArchFindMember(Var_Value (ARCHIVE, gn, &p1),
- Var_Value (MEMBER, gn, &p2),
+ arch = ArchFindMember(Var_Value(ARCHIVE, gn),
+ Var_Value(MEMBER, gn),
&arh, "r+");
- efree(p1);
- efree(p2);
sprintf(arh.ar_date, "%-12ld", (long) now);
if (arch != NULL) {
@@ -1013,14 +1010,10 @@ Arch_MTime (gn)
{
struct ar_hdr *arhPtr; /* Header of desired member */
time_t modTime; /* Modification time as an integer */
- char *p1, *p2;
- arhPtr = ArchStatMember (Var_Value (ARCHIVE, gn, &p1),
- Var_Value (MEMBER, gn, &p2),
+ arhPtr = ArchStatMember (Var_Value(ARCHIVE, gn),
+ Var_Value(MEMBER, gn),
TRUE);
- efree(p1);
- efree(p2);
-
if (arhPtr != NULL) {
modTime = (time_t) strtol(arhPtr->ar_date, NULL, 10);
} else {
diff --git a/usr.bin/make/compat.c b/usr.bin/make/compat.c
index 601b9ff72f9..299cefe3e57 100644
--- a/usr.bin/make/compat.c
+++ b/usr.bin/make/compat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: compat.c,v 1.14 1999/11/14 18:16:22 espie Exp $ */
+/* $OpenBSD: compat.c,v 1.15 1999/12/06 22:28:44 espie Exp $ */
/* $NetBSD: compat.c,v 1.14 1996/11/06 17:59:01 christos Exp $ */
/*
@@ -43,7 +43,7 @@
#if 0
static char sccsid[] = "@(#)compat.c 8.2 (Berkeley) 3/19/94";
#else
-static char rcsid[] = "$OpenBSD: compat.c,v 1.14 1999/11/14 18:16:22 espie Exp $";
+static char rcsid[] = "$OpenBSD: compat.c,v 1.15 1999/12/06 22:28:44 espie Exp $";
#endif
#endif /* not lint */
@@ -111,13 +111,11 @@ CompatInterrupt (signo)
GNode *gn;
if ((curTarg != NILGNODE) && !Targ_Precious (curTarg)) {
- char *p1;
- char *file = Var_Value (TARGET, curTarg, &p1);
+ char *file = Var_Value(TARGET, curTarg);
if (!noExecute && eunlink(file) != -1) {
Error("*** %s removed\n", file);
}
- efree(p1);
/*
* Run .INTERRUPT only if hit with interrupt signal
@@ -468,9 +466,7 @@ CompatMake (gnp, pgnp)
}
if (Lst_Member (gn->iParents, pgn) != NILLNODE) {
- char *p1;
- Var_Set (IMPSRC, Var_Value(TARGET, gn, &p1), pgn);
- efree(p1);
+ Var_Set(IMPSRC, Var_Value(TARGET, gn), pgn);
}
/*
@@ -607,10 +603,7 @@ CompatMake (gnp, pgnp)
} else if (keepgoing) {
pgn->make = FALSE;
} else {
- char *p1;
-
- printf ("\n\nStop in %s.\n", Var_Value(".CURDIR", gn, &p1));
- efree(p1);
+ printf ("\n\nStop in %s.\n", Var_Value(".CURDIR", gn));
exit (1);
}
} else if (gn->made == ERROR) {
@@ -620,11 +613,8 @@ CompatMake (gnp, pgnp)
*/
pgn->make = FALSE;
} else {
- if (Lst_Member (gn->iParents, pgn) != NILLNODE) {
- char *p1;
- Var_Set (IMPSRC, Var_Value(TARGET, gn, &p1), pgn);
- efree(p1);
- }
+ if (Lst_Member (gn->iParents, pgn) != NILLNODE)
+ Var_Set (IMPSRC, Var_Value(TARGET, gn), pgn);
switch(gn->made) {
case BEINGMADE:
Error("Graph cycles through %s\n", gn->name);
diff --git a/usr.bin/make/cond.c b/usr.bin/make/cond.c
index 54d2e7a132f..436ab50c8f0 100644
--- a/usr.bin/make/cond.c
+++ b/usr.bin/make/cond.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cond.c,v 1.5 1999/12/06 22:24:31 espie Exp $ */
+/* $OpenBSD: cond.c,v 1.6 1999/12/06 22:28:44 espie Exp $ */
/* $NetBSD: cond.c,v 1.7 1996/11/06 17:59:02 christos Exp $ */
/*
@@ -43,7 +43,7 @@
#if 0
static char sccsid[] = "@(#)cond.c 8.2 (Berkeley) 1/2/94";
#else
-static char rcsid[] = "$OpenBSD: cond.c,v 1.5 1999/12/06 22:24:31 espie Exp $";
+static char rcsid[] = "$OpenBSD: cond.c,v 1.6 1999/12/06 22:28:44 espie Exp $";
#endif
#endif /* not lint */
@@ -286,16 +286,13 @@ CondDoDefined(argLen, arg)
char *arg;
{
char savec = arg[argLen];
- char *p1;
Boolean result;
arg[argLen] = '\0';
- if (Var_Value (arg, VAR_CMD, &p1) != (char *)NULL) {
+ if (Var_Value(arg, VAR_CMD) != NULL)
result = TRUE;
- } else {
+ else
result = FALSE;
- }
- efree(p1);
arg[argLen] = savec;
return (result);
}
diff --git a/usr.bin/make/extern.h b/usr.bin/make/extern.h
index b5c8e72d54d..aa1448c16bc 100644
--- a/usr.bin/make/extern.h
+++ b/usr.bin/make/extern.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: extern.h,v 1.12 1999/12/06 22:18:56 espie Exp $ */
+/* $OpenBSD: extern.h,v 1.13 1999/12/06 22:28:44 espie Exp $ */
/* $NetBSD: nonints.h,v 1.12 1996/11/06 17:59:19 christos Exp $ */
/*-
@@ -150,7 +150,7 @@ void Var_Delete __P((char *, GNode *));
void Var_Set __P((char *, char *, GNode *));
void Var_Append __P((char *, char *, GNode *));
Boolean Var_Exists __P((char *, GNode *));
-char *Var_Value __P((char *, GNode *, char **));
+char *Var_Value __P((char *, GNode *));
char *Var_Parse __P((char *, GNode *, Boolean, int *, Boolean *));
char *Var_Subst __P((char *, char *, GNode *, Boolean));
char *Var_GetTail __P((char *));
diff --git a/usr.bin/make/job.c b/usr.bin/make/job.c
index f7973c28432..715cb9a85ce 100644
--- a/usr.bin/make/job.c
+++ b/usr.bin/make/job.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: job.c,v 1.14 1999/11/11 11:35:17 espie Exp $ */
+/* $OpenBSD: job.c,v 1.15 1999/12/06 22:28:44 espie Exp $ */
/* $NetBSD: job.c,v 1.16 1996/11/06 17:59:08 christos Exp $ */
/*
@@ -43,7 +43,7 @@
#if 0
static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94";
#else
-static char rcsid[] = "$OpenBSD: job.c,v 1.14 1999/11/11 11:35:17 espie Exp $";
+static char rcsid[] = "$OpenBSD: job.c,v 1.15 1999/12/06 22:28:44 espie Exp $";
#endif
#endif /* not lint */
@@ -1102,7 +1102,6 @@ Job_CheckCommands(gn, abortProc)
* commands
*/
if ((DEFAULT != NILGNODE) && !Lst_IsEmpty(DEFAULT->commands)) {
- char *p1;
/*
* Make only looks for a .DEFAULT if the node was never the
* target of an operator, so that's what we do too. If
@@ -1113,8 +1112,7 @@ Job_CheckCommands(gn, abortProc)
* .DEFAULT itself.
*/
Make_HandleUse(DEFAULT, gn);
- Var_Set(IMPSRC, Var_Value(TARGET, gn, &p1), gn);
- efree(p1);
+ Var_Set(IMPSRC, Var_Value(TARGET, gn), gn);
} else if (Dir_MTime(gn) == 0) {
/*
* The node wasn't the target of an operator we have no .DEFAULT
diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c
index 8785bfc0589..a9dbdac8373 100644
--- a/usr.bin/make/main.c
+++ b/usr.bin/make/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.18 1999/12/06 22:24:31 espie Exp $ */
+/* $OpenBSD: main.c,v 1.19 1999/12/06 22:28:44 espie Exp $ */
/* $NetBSD: main.c,v 1.34 1997/03/24 20:56:36 gwr Exp $ */
/*
@@ -49,7 +49,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94";
#else
-static char rcsid[] = "$OpenBSD: main.c,v 1.18 1999/12/06 22:24:31 espie Exp $";
+static char rcsid[] = "$OpenBSD: main.c,v 1.19 1999/12/06 22:28:44 espie Exp $";
#endif
#endif /* not lint */
@@ -397,8 +397,8 @@ Main_ParseArgLine(line)
char **argv; /* Manufactured argument vector */
int argc; /* Number of arguments in argv */
char *args; /* Space used by the args */
- char *buf, *p1;
- char *argv0 = Var_Value(".MAKE", VAR_GLOBAL, &p1);
+ char *buf;
+ char *argv0 = Var_Value(".MAKE", VAR_GLOBAL);
if (line == NULL)
return;
@@ -409,7 +409,6 @@ Main_ParseArgLine(line)
buf = emalloc(strlen(line) + strlen(argv0) + 2);
(void)sprintf(buf, "%s %s", argv0, line);
- efree(p1);
argv = brk_string(buf, &argc, TRUE, &args);
free(buf);
@@ -472,7 +471,7 @@ main(argc, argv)
Lst targs; /* target nodes to create -- passed to Make_Init */
Boolean outOfDate = TRUE; /* FALSE if all targets up to date */
struct stat sb, sa;
- char *p, *p1, *path, *pathp, *pwd;
+ char *p, *path, *pathp, *pwd;
char mdpath[MAXPATHLEN + 1];
char obpath[MAXPATHLEN + 1];
char cdpath[MAXPATHLEN + 1];
@@ -731,17 +730,15 @@ main(argc, argv)
(void)ReadMakefile(".depend", NULL);
- Var_Append("MFLAGS", Var_Value(MAKEFLAGS, VAR_GLOBAL, &p1), VAR_GLOBAL);
- efree(p1);
+ Var_Append("MFLAGS", Var_Value(MAKEFLAGS, VAR_GLOBAL), VAR_GLOBAL);
/* Install all the flags into the MAKE envariable. */
- if (((p = Var_Value(MAKEFLAGS, VAR_GLOBAL, &p1)) != NULL) && *p)
+ if (((p = Var_Value(MAKEFLAGS, VAR_GLOBAL)) != NULL) && *p)
#ifdef POSIX
setenv("MAKEFLAGS", p, 1);
#else
setenv("MAKE", p, 1);
#endif
- efree(p1);
/*
* For compatibility, look at the directories in the VPATH variable
@@ -792,10 +789,9 @@ main(argc, argv)
for (ln = Lst_First(variables); ln != NILLNODE;
ln = Lst_Succ(ln)) {
char *value = Var_Value((char *)Lst_Datum(ln),
- VAR_GLOBAL, &p1);
+ VAR_GLOBAL);
printf("%s\n", value ? value : "");
- efree(p1);
}
}
diff --git a/usr.bin/make/make.c b/usr.bin/make/make.c
index c0fe1372015..a8991cb2cfb 100644
--- a/usr.bin/make/make.c
+++ b/usr.bin/make/make.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: make.c,v 1.7 1998/12/05 00:06:28 espie Exp $ */
+/* $OpenBSD: make.c,v 1.8 1999/12/06 22:28:44 espie Exp $ */
/* $NetBSD: make.c,v 1.10 1996/11/06 17:59:15 christos Exp $ */
/*
@@ -43,7 +43,7 @@
#if 0
static char sccsid[] = "@(#)make.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: make.c,v 1.7 1998/12/05 00:06:28 espie Exp $";
+static char rcsid[] = "$OpenBSD: make.c,v 1.8 1999/12/06 22:28:44 espie Exp $";
#endif
#endif /* not lint */
@@ -411,10 +411,8 @@ Make_Update (cgn)
register GNode *pgn; /* the parent node */
register char *cname; /* the child's name */
register LstNode ln; /* Element in parents and iParents lists */
- char *p1;
- cname = Var_Value (TARGET, cgn, &p1);
- efree(p1);
+ cname = Var_Value(TARGET, cgn);
/*
* If the child was actually made, see what its modification time is
@@ -533,8 +531,7 @@ Make_Update (cgn)
* of this node.
*/
if (Lst_Open (cgn->iParents) == SUCCESS) {
- char *p1;
- char *cpref = Var_Value(PREFIX, cgn, &p1);
+ char *cpref = Var_Value(PREFIX, cgn);
while ((ln = Lst_Next (cgn->iParents)) != NILLNODE) {
pgn = (GNode *)Lst_Datum (ln);
@@ -543,7 +540,6 @@ Make_Update (cgn)
Var_Set (PREFIX, cpref, pgn);
}
}
- efree(p1);
Lst_Close (cgn->iParents);
}
}
@@ -578,10 +574,9 @@ MakeAddAllSrc (cgnp, pgnp)
GNode *pgn = (GNode *) pgnp;
if ((cgn->type & (OP_EXEC|OP_USE|OP_INVISIBLE)) == 0) {
char *child;
- char *p1 = NULL;
if (OP_NOP(cgn->type) ||
- (child = Var_Value(TARGET, cgn, &p1)) == NULL) {
+ (child = Var_Value(TARGET, cgn)) == NULL) {
/*
* this node is only source; use the specific pathname for it
*/
@@ -614,7 +609,6 @@ MakeAddAllSrc (cgnp, pgnp)
*/
Var_Append(OODATE, child, pgn);
}
- efree(p1);
}
return (0);
}
@@ -654,11 +648,8 @@ Make_DoAllVar (gn)
Var_Set (ALLSRC, "", gn);
}
- if (gn->type & OP_JOIN) {
- char *p1;
- Var_Set (TARGET, Var_Value (ALLSRC, gn, &p1), gn);
- efree(p1);
- }
+ if (gn->type & OP_JOIN)
+ Var_Set(TARGET, Var_Value(ALLSRC, gn), gn);
}
/*-
diff --git a/usr.bin/make/suff.c b/usr.bin/make/suff.c
index cba847e3103..c2a070833e5 100644
--- a/usr.bin/make/suff.c
+++ b/usr.bin/make/suff.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: suff.c,v 1.14 1999/10/05 22:06:24 espie Exp $ */
+/* $OpenBSD: suff.c,v 1.15 1999/12/06 22:28:44 espie Exp $ */
/* $NetBSD: suff.c,v 1.13 1996/11/06 17:59:25 christos Exp $ */
/*
@@ -43,7 +43,7 @@
#if 0
static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94";
#else
-static char rcsid[] = "$OpenBSD: suff.c,v 1.14 1999/10/05 22:06:24 espie Exp $";
+static char rcsid[] = "$OpenBSD: suff.c,v 1.15 1999/12/06 22:28:44 espie Exp $";
#endif
#endif /* not lint */
@@ -1732,9 +1732,7 @@ SuffFindArchiveDeps(gn, slst)
* Copy in the variables from the member node to this one.
*/
for (i = (sizeof(copy)/sizeof(copy[0]))-1; i >= 0; i--) {
- char *p1;
- Var_Set(copy[i], Var_Value(copy[i], mem, &p1), gn);
- efree(p1);
+ Var_Set(copy[i], Var_Value(copy[i], mem), gn);
}
diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c
index 59f28e572f5..1a809ab7bf4 100644
--- a/usr.bin/make/var.c
+++ b/usr.bin/make/var.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: var.c,v 1.17 1999/12/06 22:27:37 espie Exp $ */
+/* $OpenBSD: var.c,v 1.18 1999/12/06 22:28:44 espie Exp $ */
/* $NetBSD: var.c,v 1.18 1997/03/18 19:24:46 christos Exp $ */
/*
@@ -70,7 +70,7 @@
#if 0
static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94";
#else
-static char rcsid[] = "$OpenBSD: var.c,v 1.17 1999/12/06 22:27:37 espie Exp $";
+static char rcsid[] = "$OpenBSD: var.c,v 1.18 1999/12/06 22:28:44 espie Exp $";
#endif
#endif /* not lint */
@@ -591,15 +591,13 @@ Var_Exists(name, ctxt)
*-----------------------------------------------------------------------
*/
char *
-Var_Value (name, ctxt, frp)
+Var_Value(name, ctxt)
char *name; /* name to find */
GNode *ctxt; /* context in which to search for it */
- char **frp;
{
Var *v;
v = VarFind (name, ctxt, FIND_ENV | FIND_GLOBAL | FIND_CMD);
- *frp = NULL;
if (v != (Var *) NIL) {
char *p = Buf_GetAll(v->val, NULL);
return p;