From e571f8f77c821803b7c8084feb8283f6dd32db1e Mon Sep 17 00:00:00 2001 From: harti Date: Tue, 10 May 2005 12:02:15 +0000 Subject: [PATCH] Var_SubstOnly() is only used to subsitute a variable from the global context (and only in one place to substitute the .for variable). Therefor there is no need to pass the context as a parameter. Patch: 7.197 Submitted by: Max Okumoto --- usr.bin/make/for.c | 3 +-- usr.bin/make/var.c | 3 ++- usr.bin/make/var.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.bin/make/for.c b/usr.bin/make/for.c index f0e0b4eecee3..15372b648e95 100644 --- a/usr.bin/make/for.c +++ b/usr.bin/make/for.c @@ -271,8 +271,7 @@ For_Run(int lineno) Var_Set(var, val, VAR_GLOBAL); DEBUGF(FOR, ("--- %s = %s\n", var, val)); - str = Buf_Peel(Var_SubstOnly(var, Buf_Data(buf), - VAR_GLOBAL, FALSE)); + str = Buf_Peel(Var_SubstOnly(var, Buf_Data(buf), FALSE)); Parse_FromString(str, lineno); Var_Delete(var, VAR_GLOBAL); diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c index a23069dc56b2..4873af241d14 100644 --- a/usr.bin/make/var.c +++ b/usr.bin/make/var.c @@ -2380,8 +2380,9 @@ Var_Subst(const char *str, GNode *ctxt, Boolean err) * None. The old string must be freed by the caller */ Buffer * -Var_SubstOnly(const char *var, const char *str, GNode *ctxt, Boolean err) +Var_SubstOnly(const char *var, const char *str, Boolean err) { + GNode *ctxt = VAR_GLOBAL; Boolean errorReported; Buffer *buf; /* Buffer for forming things */ diff --git a/usr.bin/make/var.h b/usr.bin/make/var.h index 5f1948db9d7e..2294b95866f7 100644 --- a/usr.bin/make/var.h +++ b/usr.bin/make/var.h @@ -61,7 +61,7 @@ char *Var_Parse(const char *, struct GNode *, Boolean, size_t *, Boolean *); void Var_Set(const char *, const char *, struct GNode *); void Var_SetEnv(const char *, struct GNode *); struct Buffer *Var_Subst(const char *, struct GNode *, Boolean); -struct Buffer *Var_SubstOnly(const char *, const char *, struct GNode *, Boolean); +struct Buffer *Var_SubstOnly(const char *, const char *, Boolean); char *Var_Value(const char *, struct GNode *, char **); #endif /* var_h_9cccafce */