diff options
author | harti <harti@FreeBSD.org> | 2005-05-12 14:31:42 +0000 |
---|---|---|
committer | harti <harti@FreeBSD.org> | 2005-05-12 14:31:42 +0000 |
commit | 8a832592ce11ab5f5c94757893e5f7353808bee1 (patch) | |
tree | 4063d4c37b93bccf895ea505b1cd72847fc1b684 /usr.bin/make/main.c | |
parent | e7ab78380c4d30d28dbf699ac0bffeb881f56c83 (diff) | |
download | FreeBSD-src-8a832592ce11ab5f5c94757893e5f7353808bee1.zip FreeBSD-src-8a832592ce11ab5f5c94757893e5f7353808bee1.tar.gz |
Move variable printing from main.c to var.c
Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.233)
Diffstat (limited to 'usr.bin/make/main.c')
-rw-r--r-- | usr.bin/make/main.c | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c index 8e41fd8..ea4253b 100644 --- a/usr.bin/make/main.c +++ b/usr.bin/make/main.c @@ -988,34 +988,7 @@ main(int argc, char **argv) Lst_Destroy(&targs, NOFREE); } else { - /* - * Print the values of any variables requested by - * the user. - */ - LstNode *n; - const char *name; - char *v; - char *value; - - LST_FOREACH(n, &variables) { - name = Lst_Datum(n); - if (expandVars) { - v = emalloc(strlen(name) + 1 + 3); - sprintf(v, "${%s}", name); - - 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); - printf("%s\n", value != NULL ? value : ""); - if (v != NULL) - free(v); - } - } + Var_Print(&variables, expandVars); } Lst_Destroy(&variables, free); |