diff options
author | harti <harti@FreeBSD.org> | 2005-05-24 15:58:35 +0000 |
---|---|---|
committer | harti <harti@FreeBSD.org> | 2005-05-24 15:58:35 +0000 |
commit | 79613308dce9cef12aa10cea972360bae9c444f3 (patch) | |
tree | 0da9d886dad87a41f07234fde57509940807459f /usr.bin/make/var.c | |
parent | 910dc606b98c3d428364a2e4a51431f0cc14bcce (diff) | |
download | FreeBSD-src-79613308dce9cef12aa10cea972360bae9c444f3.zip FreeBSD-src-79613308dce9cef12aa10cea972360bae9c444f3.tar.gz |
Get rid of the third argument to Var_Value() the pointer it pointed
to has always been set to NULL for some time now.
Obtained from: DragonFlyBSD
Diffstat (limited to 'usr.bin/make/var.c')
-rw-r--r-- | usr.bin/make/var.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c index cb40a49..9300770 100644 --- a/usr.bin/make/var.c +++ b/usr.bin/make/var.c @@ -1142,26 +1142,22 @@ Var_Exists(const char *name, GNode *ctxt) * Return the value of the named variable in the given context * * Results: - * The value if the variable exists, NULL if it doesn't + * The value if the variable exists, NULL if it doesn't. */ char * -Var_Value(const char *name, GNode *ctxt, char **frp) +Var_Value(const char name[], GNode *ctxt) { Var *v; char *n; - char *p; n = VarPossiblyExpand(name, ctxt); v = VarFindAny(n, ctxt); + free(n); if (v == NULL) { - p = NULL; - *frp = NULL; + return (NULL); } else { - p = Buf_Data(v->val); - *frp = NULL; + return (Buf_Data(v->val)); } - free(n); - return (p); } /** @@ -2558,17 +2554,14 @@ Var_Print(Lst *vlist, Boolean expandVars) v = emalloc(strlen(name) + 1 + 3); sprintf(v, "${%s}", name); - value = Buf_Peel(Var_Subst(v, - VAR_GLOBAL, FALSE)); + value = Buf_Peel(Var_Subst(v, VAR_GLOBAL, FALSE)); printf("%s\n", value); free(v); free(value); } else { - value = Var_Value(name, VAR_GLOBAL, &v); + value = Var_Value(name, VAR_GLOBAL); printf("%s\n", value != NULL ? value : ""); - if (v != NULL) - free(v); } } } |