aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/make/main.c
diff options
context:
space:
mode:
authorHartmut Brandt <harti@FreeBSD.org>2005-05-12 14:31:42 +0000
committerHartmut Brandt <harti@FreeBSD.org>2005-05-12 14:31:42 +0000
commit7594df85cff65c7ac3a797a9ee56c15b78561984 (patch)
tree4063d4c37b93bccf895ea505b1cd72847fc1b684 /usr.bin/make/main.c
parent8b8eb9e2ab2ce467d85186909ab0bf9ca1dfa7da (diff)
downloadsrc-7594df85cff65c7ac3a797a9ee56c15b78561984.tar.gz
src-7594df85cff65c7ac3a797a9ee56c15b78561984.zip
Move variable printing from main.c to var.c
Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.233)
Notes
Notes: svn path=/head/; revision=146141
Diffstat (limited to 'usr.bin/make/main.c')
-rw-r--r--usr.bin/make/main.c29
1 files changed, 1 insertions, 28 deletions
diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c
index 8e41fd8e0f39..ea4253b6a0f6 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);