summaryrefslogtreecommitdiff
path: root/usr.bin/make
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2007-07-08 17:53:16 +0000
committerMarc Espie <espie@cvs.openbsd.org>2007-07-08 17:53:16 +0000
commit4986ba09bd281456f0125b371071cab6130e04e2 (patch)
tree085f0478ad21509b646fe0b4ffc2e5cc2bc5df91 /usr.bin/make
parent1013db60a1fb319a681ce95448fc05cfda8c9987 (diff)
rename variable to errorIsOkay. What does oldVars mean anyway ?
Diffstat (limited to 'usr.bin/make')
-rw-r--r--usr.bin/make/parsevar.c15
-rw-r--r--usr.bin/make/var.c8
-rw-r--r--usr.bin/make/var.h2
3 files changed, 13 insertions, 12 deletions
diff --git a/usr.bin/make/parsevar.c b/usr.bin/make/parsevar.c
index 282e6ea3753..aee4543958f 100644
--- a/usr.bin/make/parsevar.c
+++ b/usr.bin/make/parsevar.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: parsevar.c,v 1.3 2007/07/08 17:44:20 espie Exp $ */
+/* $OpenBSD: parsevar.c,v 1.4 2007/07/08 17:53:15 espie Exp $ */
/* $NetBSD: parse.c,v 1.29 1997/03/10 21:20:04 christos Exp $ */
/*
@@ -172,7 +172,7 @@ parse_variable_assignment(const char *line,
if (type & VAR_SUBST) {
/*
* Allow variables in the old value to be undefined, but leave their
- * invocation alone -- this is done by forcing oldVars to be false.
+ * invocation alone -- this is done by forcing errorIsOkay to be false.
* XXX: This can cause recursive variables, but that's not hard to do,
* and this allows someone to do something like
*
@@ -181,16 +181,16 @@ parse_variable_assignment(const char *line,
*
* And not get an error.
*/
- bool oldOldVars = oldVars;
+ bool saved = errorIsOkay;
- oldVars = false;
+ errorIsOkay = false;
/* ensure the variable is set to something to avoid `variable
* is recursive' errors. */
if (Var_Valuei(name.s, name.e) == NULL)
Var_Seti(name.s, name.e, "", ctxt);
res2 = Var_Subst(arg, NULL, false);
- oldVars = oldOldVars;
+ errorIsOkay = saved;
arg = res2;
}
@@ -216,10 +216,11 @@ bool
Parse_CmdlineVar(const char *line)
{
bool result;
+ bool saved = errorIsOkay;
- oldVars = false;
+ errorIsOkay = false;
result = parse_variable_assignment(line, VAR_CMD);
- oldVars = true;
+ errorIsOkay = errorIsOkay;
return result;
}
diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c
index 18a58342383..850c6db260f 100644
--- a/usr.bin/make/var.c
+++ b/usr.bin/make/var.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: var.c,v 1.63 2007/07/08 17:49:55 espie Exp $ */
+/* $OpenBSD: var.c,v 1.64 2007/07/08 17:53:15 espie Exp $ */
/* $NetBSD: var.c,v 1.18 1997/03/18 19:24:46 christos Exp $ */
/*
@@ -111,7 +111,7 @@ char var_Error[] = "";
* identical string instances...
*/
static char varNoError[] = "";
-bool oldVars; /* variable substitution style */
+bool errorIsOkay;
static bool checkEnvFirst; /* true if environment should be searched for
* variables before the global context */
@@ -927,7 +927,7 @@ Var_Subst(const char *str, /* the string in which to substitute */
* the variable and continue with the substitution. Otherwise,
* store the dollar sign and advance str so we continue with
* the string... */
- if (oldVars)
+ if (errorIsOkay)
str += length;
else if (undefErr) {
/* If variable is undefined, complain and skip the
@@ -1087,7 +1087,7 @@ Var_Init(void)
set_magic_shell_variable();
- oldVars = true;
+ errorIsOkay = true;
Var_setCheckEnvFirst(false);
VarModifiers_Init();
diff --git a/usr.bin/make/var.h b/usr.bin/make/var.h
index 223b0e1a188..01c15efd13a 100644
--- a/usr.bin/make/var.h
+++ b/usr.bin/make/var.h
@@ -131,7 +131,7 @@ extern void Var_Dump(void);
extern void Var_AddCmdline(const char *);
/* stuff common to var.c and varparse.c */
-extern bool oldVars; /* Do old-style variable substitution */
+extern bool errorIsOkay;
#define VAR_GLOBAL 0
/* Variables defined in a global context, e.g in the Makefile itself */