summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/make/arch.c2
-rw-r--r--usr.bin/make/compat.c2
-rw-r--r--usr.bin/make/for.c2
-rw-r--r--usr.bin/make/lst.lib/lstAddNew.c2
-rw-r--r--usr.bin/make/lst.lib/lstAppend.c2
-rw-r--r--usr.bin/make/lst.lib/lstConcat.c2
-rw-r--r--usr.bin/make/lst.lib/lstConcatDestroy.c2
-rw-r--r--usr.bin/make/lst.lib/lstDeQueue.c2
-rw-r--r--usr.bin/make/lst.lib/lstDestroy.c2
-rw-r--r--usr.bin/make/lst.lib/lstDupl.c2
-rw-r--r--usr.bin/make/lst.lib/lstFindFrom.c2
-rw-r--r--usr.bin/make/lst.lib/lstForEachFrom.c2
-rw-r--r--usr.bin/make/lst.lib/lstInit.c2
-rw-r--r--usr.bin/make/lst.lib/lstInsert.c2
-rw-r--r--usr.bin/make/lst.lib/lstMember.c2
-rw-r--r--usr.bin/make/lst.lib/lstRemove.c2
-rw-r--r--usr.bin/make/lst.lib/lstReplace.c2
-rw-r--r--usr.bin/make/lst.lib/lstSucc.c2
-rw-r--r--usr.bin/make/main.c34
-rw-r--r--usr.bin/make/parse.c4
-rw-r--r--usr.bin/make/parsevar.c8
-rw-r--r--usr.bin/make/suff.c6
-rw-r--r--usr.bin/make/var.c11
-rw-r--r--usr.bin/make/var.h14
-rw-r--r--usr.bin/make/varmodifiers.c12
-rw-r--r--usr.bin/make/varmodifiers.h2
26 files changed, 66 insertions, 61 deletions
diff --git a/usr.bin/make/arch.c b/usr.bin/make/arch.c
index 23806f3d76f..5d64ec6b818 100644
--- a/usr.bin/make/arch.c
+++ b/usr.bin/make/arch.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: arch.c,v 1.59 2007/07/24 18:58:48 espie Exp $ */
+/* $OpenBSD: arch.c,v 1.60 2007/07/30 09:51:53 espie Exp $ */
/* $NetBSD: arch.c,v 1.17 1996/11/06 17:58:59 christos Exp $ */
/*
diff --git a/usr.bin/make/compat.c b/usr.bin/make/compat.c
index 8d4e55aa181..60b8a89cfe4 100644
--- a/usr.bin/make/compat.c
+++ b/usr.bin/make/compat.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: compat.c,v 1.52 2007/07/30 09:49:00 espie Exp $ */
+/* $OpenBSD: compat.c,v 1.53 2007/07/30 09:51:53 espie Exp $ */
/* $NetBSD: compat.c,v 1.14 1996/11/06 17:59:01 christos Exp $ */
/*
diff --git a/usr.bin/make/for.c b/usr.bin/make/for.c
index 7bc3982fdfe..a3f79ad5a6f 100644
--- a/usr.bin/make/for.c
+++ b/usr.bin/make/for.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: for.c,v 1.36 2007/07/24 23:29:49 espie Exp $ */
+/* $OpenBSD: for.c,v 1.37 2007/07/30 09:51:53 espie Exp $ */
/* $NetBSD: for.c,v 1.4 1996/11/06 17:59:05 christos Exp $ */
/*
diff --git a/usr.bin/make/lst.lib/lstAddNew.c b/usr.bin/make/lst.lib/lstAddNew.c
index 0339a195d20..83ace288788 100644
--- a/usr.bin/make/lst.lib/lstAddNew.c
+++ b/usr.bin/make/lst.lib/lstAddNew.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: lstAddNew.c,v 1.5 2007/07/29 13:49:54 espie Exp $ */
+/* $OpenBSD: lstAddNew.c,v 1.6 2007/07/30 09:51:53 espie Exp $ */
/* ex:ts=8 sw=4:
*/
diff --git a/usr.bin/make/lst.lib/lstAppend.c b/usr.bin/make/lst.lib/lstAppend.c
index 09876dfc619..b96ae31dbf1 100644
--- a/usr.bin/make/lst.lib/lstAppend.c
+++ b/usr.bin/make/lst.lib/lstAppend.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: lstAppend.c,v 1.17 2007/07/29 13:49:54 espie Exp $ */
+/* $OpenBSD: lstAppend.c,v 1.18 2007/07/30 09:51:53 espie Exp $ */
/* $NetBSD: lstAppend.c,v 1.5 1996/11/06 17:59:31 christos Exp $ */
/*
diff --git a/usr.bin/make/lst.lib/lstConcat.c b/usr.bin/make/lst.lib/lstConcat.c
index 262f8e48d18..b855bc073ab 100644
--- a/usr.bin/make/lst.lib/lstConcat.c
+++ b/usr.bin/make/lst.lib/lstConcat.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: lstConcat.c,v 1.17 2007/07/29 13:49:54 espie Exp $ */
+/* $OpenBSD: lstConcat.c,v 1.18 2007/07/30 09:51:53 espie Exp $ */
/* $NetBSD: lstConcat.c,v 1.6 1996/11/06 17:59:34 christos Exp $ */
/*
diff --git a/usr.bin/make/lst.lib/lstConcatDestroy.c b/usr.bin/make/lst.lib/lstConcatDestroy.c
index 9afb730b0ae..6c37a27c4ed 100644
--- a/usr.bin/make/lst.lib/lstConcatDestroy.c
+++ b/usr.bin/make/lst.lib/lstConcatDestroy.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: lstConcatDestroy.c,v 1.8 2007/07/29 13:49:54 espie Exp $ */
+/* $OpenBSD: lstConcatDestroy.c,v 1.9 2007/07/30 09:51:53 espie Exp $ */
/* $NetBSD: lstConcat.c,v 1.6 1996/11/06 17:59:34 christos Exp $ */
/*
diff --git a/usr.bin/make/lst.lib/lstDeQueue.c b/usr.bin/make/lst.lib/lstDeQueue.c
index 5503efdf770..7868a76aef7 100644
--- a/usr.bin/make/lst.lib/lstDeQueue.c
+++ b/usr.bin/make/lst.lib/lstDeQueue.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: lstDeQueue.c,v 1.16 2007/07/29 13:49:54 espie Exp $ */
+/* $OpenBSD: lstDeQueue.c,v 1.17 2007/07/30 09:51:53 espie Exp $ */
/* $NetBSD: lstDeQueue.c,v 1.5 1996/11/06 17:59:36 christos Exp $ */
/*
diff --git a/usr.bin/make/lst.lib/lstDestroy.c b/usr.bin/make/lst.lib/lstDestroy.c
index 3452fc55a57..f918dcc2470 100644
--- a/usr.bin/make/lst.lib/lstDestroy.c
+++ b/usr.bin/make/lst.lib/lstDestroy.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: lstDestroy.c,v 1.17 2007/07/29 13:49:54 espie Exp $ */
+/* $OpenBSD: lstDestroy.c,v 1.18 2007/07/30 09:51:53 espie Exp $ */
/* $NetBSD: lstDestroy.c,v 1.6 1996/11/06 17:59:37 christos Exp $ */
/*
diff --git a/usr.bin/make/lst.lib/lstDupl.c b/usr.bin/make/lst.lib/lstDupl.c
index 5b66ac4caa8..cb11d618ebc 100644
--- a/usr.bin/make/lst.lib/lstDupl.c
+++ b/usr.bin/make/lst.lib/lstDupl.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: lstDupl.c,v 1.19 2007/07/29 13:49:54 espie Exp $ */
+/* $OpenBSD: lstDupl.c,v 1.20 2007/07/30 09:51:53 espie Exp $ */
/* $NetBSD: lstDupl.c,v 1.6 1996/11/06 17:59:37 christos Exp $ */
/*
diff --git a/usr.bin/make/lst.lib/lstFindFrom.c b/usr.bin/make/lst.lib/lstFindFrom.c
index 3da40032d9e..8655f1502c8 100644
--- a/usr.bin/make/lst.lib/lstFindFrom.c
+++ b/usr.bin/make/lst.lib/lstFindFrom.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: lstFindFrom.c,v 1.15 2007/07/29 13:49:54 espie Exp $ */
+/* $OpenBSD: lstFindFrom.c,v 1.16 2007/07/30 09:51:53 espie Exp $ */
/* $NetBSD: lstFindFrom.c,v 1.6 1996/11/06 17:59:40 christos Exp $ */
/*
diff --git a/usr.bin/make/lst.lib/lstForEachFrom.c b/usr.bin/make/lst.lib/lstForEachFrom.c
index d8ae435f2a5..8d08177e9cf 100644
--- a/usr.bin/make/lst.lib/lstForEachFrom.c
+++ b/usr.bin/make/lst.lib/lstForEachFrom.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: lstForEachFrom.c,v 1.16 2007/07/29 13:49:54 espie Exp $ */
+/* $OpenBSD: lstForEachFrom.c,v 1.17 2007/07/30 09:51:53 espie Exp $ */
/* $NetBSD: lstForEachFrom.c,v 1.5 1996/11/06 17:59:42 christos Exp $ */
/*
diff --git a/usr.bin/make/lst.lib/lstInit.c b/usr.bin/make/lst.lib/lstInit.c
index 86839ed1cb4..1aae7c9f55c 100644
--- a/usr.bin/make/lst.lib/lstInit.c
+++ b/usr.bin/make/lst.lib/lstInit.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: lstInit.c,v 1.16 2007/07/29 13:49:54 espie Exp $ */
+/* $OpenBSD: lstInit.c,v 1.17 2007/07/30 09:51:53 espie Exp $ */
/* $NetBSD: lstInit.c,v 1.5 1996/11/06 17:59:43 christos Exp $ */
/*
diff --git a/usr.bin/make/lst.lib/lstInsert.c b/usr.bin/make/lst.lib/lstInsert.c
index 4b590b3899f..0ec9ee8dcb4 100644
--- a/usr.bin/make/lst.lib/lstInsert.c
+++ b/usr.bin/make/lst.lib/lstInsert.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: lstInsert.c,v 1.17 2007/07/29 13:49:54 espie Exp $ */
+/* $OpenBSD: lstInsert.c,v 1.18 2007/07/30 09:51:53 espie Exp $ */
/* $NetBSD: lstInsert.c,v 1.5 1996/11/06 17:59:44 christos Exp $ */
/*
diff --git a/usr.bin/make/lst.lib/lstMember.c b/usr.bin/make/lst.lib/lstMember.c
index d7290cc7d6e..0a79eb3d7b5 100644
--- a/usr.bin/make/lst.lib/lstMember.c
+++ b/usr.bin/make/lst.lib/lstMember.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: lstMember.c,v 1.14 2007/07/29 13:49:54 espie Exp $ */
+/* $OpenBSD: lstMember.c,v 1.15 2007/07/30 09:51:53 espie Exp $ */
/* $NetBSD: lstMember.c,v 1.5 1996/11/06 17:59:48 christos Exp $ */
/*
diff --git a/usr.bin/make/lst.lib/lstRemove.c b/usr.bin/make/lst.lib/lstRemove.c
index 8b8b97eeee9..484a2d10988 100644
--- a/usr.bin/make/lst.lib/lstRemove.c
+++ b/usr.bin/make/lst.lib/lstRemove.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: lstRemove.c,v 1.16 2007/07/29 13:49:54 espie Exp $ */
+/* $OpenBSD: lstRemove.c,v 1.17 2007/07/30 09:51:53 espie Exp $ */
/* $NetBSD: lstRemove.c,v 1.5 1996/11/06 17:59:50 christos Exp $ */
/*
diff --git a/usr.bin/make/lst.lib/lstReplace.c b/usr.bin/make/lst.lib/lstReplace.c
index 3230a503553..3988ec83118 100644
--- a/usr.bin/make/lst.lib/lstReplace.c
+++ b/usr.bin/make/lst.lib/lstReplace.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: lstReplace.c,v 1.15 2007/07/29 13:49:54 espie Exp $ */
+/* $OpenBSD: lstReplace.c,v 1.16 2007/07/30 09:51:53 espie Exp $ */
/* $NetBSD: lstReplace.c,v 1.5 1996/11/06 17:59:51 christos Exp $ */
/*
diff --git a/usr.bin/make/lst.lib/lstSucc.c b/usr.bin/make/lst.lib/lstSucc.c
index 265c7101858..734525abbda 100644
--- a/usr.bin/make/lst.lib/lstSucc.c
+++ b/usr.bin/make/lst.lib/lstSucc.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: lstSucc.c,v 1.14 2007/07/29 13:49:54 espie Exp $ */
+/* $OpenBSD: lstSucc.c,v 1.15 2007/07/30 09:51:53 espie Exp $ */
/* $NetBSD: lstSucc.c,v 1.5 1996/11/06 17:59:52 christos Exp $ */
/*
diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c
index 9750a402ec5..d76e5759274 100644
--- a/usr.bin/make/main.c
+++ b/usr.bin/make/main.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: main.c,v 1.75 2007/07/30 09:39:18 espie Exp $ */
+/* $OpenBSD: main.c,v 1.76 2007/07/30 09:51:53 espie Exp $ */
/* $NetBSD: main.c,v 1.34 1997/03/24 20:56:36 gwr Exp $ */
/*
@@ -134,9 +134,9 @@ static void record_option(int c, const char *arg)
opt[0] = '-';
opt[1] = c;
opt[2] = '\0';
- Var_Append(MAKEFLAGS, opt, VAR_GLOBAL);
+ Var_Append(MAKEFLAGS, opt);
if (arg != NULL)
- Var_Append(MAKEFLAGS, arg, VAR_GLOBAL);
+ Var_Append(MAKEFLAGS, arg);
}
static void
@@ -220,7 +220,7 @@ MainParseArgs(int argc, char **argv)
c = optend ? -1 : getopt(argc, argv, OPTFLAGS);
switch (c) {
case 'D':
- Var_Set(optarg, "1", VAR_GLOBAL);
+ Var_Set(optarg, "1");
record_option(c, optarg);
break;
case 'I':
@@ -691,8 +691,8 @@ main(int argc, char **argv)
if (d.object != d.current)
Dir_AddDir(dirSearchPath, d.current);
- Var_Set(".CURDIR", d.current, VAR_GLOBAL);
- Var_Set(".OBJDIR", d.object, VAR_GLOBAL);
+ Var_Set(".CURDIR", d.current);
+ Var_Set(".OBJDIR", d.object);
/*
* Initialize various variables.
@@ -700,12 +700,12 @@ main(int argc, char **argv)
* .MAKEFLAGS gets set to the empty string just in case.
* MFLAGS also gets initialized empty, for compatibility.
*/
- Var_Set("MAKE", argv[0], VAR_GLOBAL);
- Var_Set(".MAKE", argv[0], VAR_GLOBAL);
- Var_Set(MAKEFLAGS, "", VAR_GLOBAL);
- Var_Set("MFLAGS", "", VAR_GLOBAL);
- Var_Set("MACHINE", machine, VAR_GLOBAL);
- Var_Set("MACHINE_ARCH", machine_arch, VAR_GLOBAL);
+ Var_Set("MAKE", argv[0]);
+ Var_Set(".MAKE", argv[0]);
+ Var_Set(MAKEFLAGS, "");
+ Var_Set("MFLAGS", "");
+ Var_Set("MACHINE", machine);
+ Var_Set("MACHINE_ARCH", machine_arch);
/*
* First snag any flags out of the MAKEFLAGS environment variable.
@@ -731,10 +731,10 @@ main(int argc, char **argv)
for (ln = Lst_First(create); ln != NULL; ln = Lst_Adv(ln)) {
char *name = (char *)Lst_Datum(ln);
- Var_Append(".TARGETS", name, VAR_GLOBAL);
+ Var_Append(".TARGETS", name);
}
} else
- Var_Set(".TARGETS", "", VAR_GLOBAL);
+ Var_Set(".TARGETS", "");
/*
@@ -747,7 +747,7 @@ main(int argc, char **argv)
read_all_make_rules(noBuiltins, &makefiles, &d);
- Var_Append("MFLAGS", Var_Value(MAKEFLAGS), VAR_GLOBAL);
+ Var_Append("MFLAGS", Var_Value(MAKEFLAGS));
/* Install all the flags into the MAKEFLAGS env variable. */
if (((p = Var_Value(MAKEFLAGS)) != NULL) && *p)
@@ -844,7 +844,7 @@ ReadMakefile(void *p, void *q)
char *name;
if (!strcmp(fname, "-")) {
- Var_Set("MAKEFILE", "", VAR_GLOBAL);
+ Var_Set("MAKEFILE", "");
Parse_File(estrdup("(stdin)"), stdin);
} else {
if ((stream = fopen(fname, "r")) != NULL)
@@ -873,7 +873,7 @@ ReadMakefile(void *p, void *q)
* placement of the setting here means it gets set to the last
* makefile specified, as it is set by SysV make.
*/
-found: Var_Set("MAKEFILE", fname, VAR_GLOBAL);
+found: Var_Set("MAKEFILE", fname);
Parse_File(fname, stream);
}
return true;
diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c
index f68e5ae7b0f..100a9d9e38c 100644
--- a/usr.bin/make/parse.c
+++ b/usr.bin/make/parse.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: parse.c,v 1.77 2007/07/30 09:32:02 espie Exp $ */
+/* $OpenBSD: parse.c,v 1.78 2007/07/30 09:51:53 espie Exp $ */
/* $NetBSD: parse.c,v 1.29 1997/03/10 21:20:04 christos Exp $ */
/*
@@ -436,7 +436,7 @@ ParseDoSrc(
* Add the name to the .TARGETS variable as well, so the user can
* employ that, if desired.
*/
- Var_Append(".TARGETS", src, VAR_GLOBAL);
+ Var_Append(".TARGETS", src);
return;
case Order:
diff --git a/usr.bin/make/parsevar.c b/usr.bin/make/parsevar.c
index 4718ad46c6e..60fda2fc52b 100644
--- a/usr.bin/make/parsevar.c
+++ b/usr.bin/make/parsevar.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: parsevar.c,v 1.7 2007/07/30 09:29:53 espie Exp $ */
+/* $OpenBSD: parsevar.c,v 1.8 2007/07/30 09:51:53 espie Exp $ */
/* $NetBSD: parse.c,v 1.29 1997/03/10 21:20:04 christos Exp $ */
/*
@@ -184,7 +184,7 @@ parse_variable_assignment(const char *line, int ctxt)
/* ensure the variable is set to something to avoid `variable
* is recursive' errors. */
if (!Var_Definedi(name.s, name.e))
- Var_Seti(name.s, name.e, "", ctxt);
+ Var_Seti_with_ctxt(name.s, name.e, "", ctxt);
res2 = Var_Subst(arg, NULL, false);
errorIsOkay = saved;
@@ -193,9 +193,9 @@ parse_variable_assignment(const char *line, int ctxt)
}
if (type & VAR_APPEND)
- Var_Appendi(name.s, name.e, arg, ctxt);
+ Var_Appendi_with_ctxt(name.s, name.e, arg, ctxt);
else
- Var_Seti(name.s, name.e, arg, ctxt);
+ Var_Seti_with_ctxt(name.s, name.e, arg, ctxt);
VarName_Free(&name);
free(res2);
diff --git a/usr.bin/make/suff.c b/usr.bin/make/suff.c
index 1fc22a8a5ad..e4b69bd670b 100644
--- a/usr.bin/make/suff.c
+++ b/usr.bin/make/suff.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: suff.c,v 1.59 2007/07/24 18:58:48 espie Exp $ */
+/* $OpenBSD: suff.c,v 1.60 2007/07/30 09:51:53 espie Exp $ */
/* $NetBSD: suff.c,v 1.13 1996/11/06 17:59:25 christos Exp $ */
/*
@@ -792,9 +792,9 @@ Suff_DoPaths(void)
Lst_Clone(&s->searchPath, dirSearchPath, Dir_CopyDir);
}
- Var_Set(".INCLUDES", ptr = Dir_MakeFlags("-I", &inIncludes), VAR_GLOBAL);
+ Var_Set(".INCLUDES", ptr = Dir_MakeFlags("-I", &inIncludes));
free(ptr);
- Var_Set(".LIBS", ptr = Dir_MakeFlags("-L", &inLibs), VAR_GLOBAL);
+ Var_Set(".LIBS", ptr = Dir_MakeFlags("-L", &inLibs));
free(ptr);
Lst_Destroy(&inIncludes, Dir_Destroy);
diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c
index afd0ba9f80d..04a684e9845 100644
--- a/usr.bin/make/var.c
+++ b/usr.bin/make/var.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: var.c,v 1.72 2007/07/30 09:47:21 espie Exp $ */
+/* $OpenBSD: var.c,v 1.73 2007/07/30 09:51:53 espie Exp $ */
/* $NetBSD: var.c,v 1.18 1997/03/18 19:24:46 christos Exp $ */
/*
@@ -697,13 +697,15 @@ var_set_append(const char *name, const char *ename, const char *val, int ctxt,
}
void
-Var_Seti(const char *name, const char *ename, const char *val, int ctxt)
+Var_Seti_with_ctxt(const char *name, const char *ename, const char *val,
+ int ctxt)
{
var_set_append(name, ename, val, ctxt, false);
}
void
-Var_Appendi(const char *name, const char *ename, const char *val, int ctxt)
+Var_Appendi_with_ctxt(const char *name, const char *ename, const char *val,
+ int ctxt)
{
var_set_append(name, ename, val, ctxt, true);
}
@@ -854,6 +856,7 @@ parse_base_variable_name(const char **pstr, struct Name *name, SymTable *ctxt)
bool
Var_ParseSkip(const char **pstr, SymTable *ctxt)
{
+ Var *v;
const char *str = *pstr;
struct Name name;
bool result;
@@ -1340,6 +1343,6 @@ Var_AddCmdline(const char *name)
}
Buf_AddSpace(&buf);
}
- Var_Append(name, Buf_Retrieve(&buf), VAR_GLOBAL);
+ Var_Append(name, Buf_Retrieve(&buf));
Buf_Destroy(&buf);
}
diff --git a/usr.bin/make/var.h b/usr.bin/make/var.h
index 8eab4551a1a..0617f79b9b7 100644
--- a/usr.bin/make/var.h
+++ b/usr.bin/make/var.h
@@ -44,18 +44,20 @@ extern char *Var_Valuei(const char *, const char *);
* Checks whether global variable name/end is defined. */
extern bool Var_Definedi(const char *, const char *);
-/* Var_Seti(name, end, val, ctxt);
+/* Var_Seti_with_ctxt(name, end, val, ctxt);
* Sets value val of variable name/end. Copies val.
* ctxt can be VAR_CMD (command line) or VAR_GLOBAL (normal variable). */
-extern void Var_Seti(const char *, const char *, const char *,
+extern void Var_Seti_with_ctxt(const char *, const char *, const char *,
int);
-#define Var_Set(n, v, ctxt) Var_Seti(n, NULL, v, ctxt)
-/* Var_Appendi(name, end, val, cxt);
+#define Var_Set(n, v) Var_Seti_with_ctxt(n, NULL, v, VAR_GLOBAL)
+#define Var_Seti(n, e, v) Var_Seti_with_ctxt(n, e, v, VAR_GLOBAL)
+/* Var_Appendi_with_ctxt(name, end, val, cxt);
* Appends value val to variable name/end in context ctxt, defining it
* if it does not already exist, and inserting one space otherwise. */
-extern void Var_Appendi(const char *, const char *,
+extern void Var_Appendi_with_ctxt(const char *, const char *,
const char *, int);
-#define Var_Append(n, v, ctxt) Var_Appendi(n, NULL, v, ctxt)
+#define Var_Append(n, v) Var_Appendi_with_ctxt(n, NULL, v, VAR_GLOBAL)
+#define Var_Appendi(n, e, v) Var_Appendi_with_ctxt(n, e, v, VAR_GLOBAL)
/* Var_Deletei(name, end);
* Deletes a global variable. */
diff --git a/usr.bin/make/varmodifiers.c b/usr.bin/make/varmodifiers.c
index 17f23325685..37be0e6efc0 100644
--- a/usr.bin/make/varmodifiers.c
+++ b/usr.bin/make/varmodifiers.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: varmodifiers.c,v 1.18 2007/07/24 18:58:48 espie Exp $ */
+/* $OpenBSD: varmodifiers.c,v 1.19 2007/07/30 09:51:53 espie Exp $ */
/* $NetBSD: var.c,v 1.18 1997/03/18 19:24:46 christos Exp $ */
/*
@@ -542,22 +542,22 @@ do_assign(const char *s, const struct Name *n, void *arg)
switch (v->flags) {
case VAR_EQUAL:
- Var_Seti(n->s, n->e, v->lbuffer, VAR_GLOBAL);
+ Var_Seti(n->s, n->e, v->lbuffer);
break;
case VAR_MAY_EQUAL:
if (s == NULL)
- Var_Seti(n->s, n->e, v->lbuffer, VAR_GLOBAL);
+ Var_Seti(n->s, n->e, v->lbuffer);
break;
case VAR_ADD_EQUAL:
if (s == NULL)
- Var_Seti(n->s, n->e, v->lbuffer, VAR_GLOBAL);
+ Var_Seti(n->s, n->e, v->lbuffer);
else
- Var_Appendi(n->s, n->e, v->lbuffer, VAR_GLOBAL);
+ Var_Appendi(n->s, n->e, v->lbuffer);
break;
case VAR_BANG_EQUAL:
result = Cmd_Exec(v->lbuffer, &msg);
if (result != NULL) {
- Var_Seti(n->s, n->e, result, VAR_GLOBAL);
+ Var_Seti(n->s, n->e, result);
free(result);
} else
Error(msg, v->lbuffer);
diff --git a/usr.bin/make/varmodifiers.h b/usr.bin/make/varmodifiers.h
index ec11eea6906..c38ffcde383 100644
--- a/usr.bin/make/varmodifiers.h
+++ b/usr.bin/make/varmodifiers.h
@@ -2,7 +2,7 @@
#define VARMODIFIERS_H
/* $OpenPackages$ */
-/* $OpenBSD: varmodifiers.h,v 1.7 2007/07/24 18:58:48 espie Exp $ */
+/* $OpenBSD: varmodifiers.h,v 1.8 2007/07/30 09:51:53 espie Exp $ */
/*
* Copyright (c) 1999 Marc Espie.