diff options
author | Julius Bünger <buenger@mytum.de> | 2018-06-07 17:22:22 +0200 |
---|---|---|
committer | Julius Bünger <buenger@mytum.de> | 2018-06-07 17:23:34 +0200 |
commit | 2cdccc796f93117f5c74ec3b586f7654307b02e0 (patch) | |
tree | c4be16e903b451ec269c2e0eab1e183dc4f07ba7 | |
parent | 7b56a05a27cfc5a5ef1403f616e2734cacc1597c (diff) | |
download | gnunet-2cdccc796f93117f5c74ec3b586f7654307b02e0.tar.gz gnunet-2cdccc796f93117f5c74ec3b586f7654307b02e0.zip |
config: file name expansion in all -f cases
-rw-r--r-- | src/util/gnunet-config.c | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/src/util/gnunet-config.c b/src/util/gnunet-config.c index 81e09fdbf..c01528a45 100644 --- a/src/util/gnunet-config.c +++ b/src/util/gnunet-config.c | |||
@@ -72,12 +72,28 @@ print_option (void *cls, | |||
72 | const char *option, | 72 | const char *option, |
73 | const char *value) | 73 | const char *value) |
74 | { | 74 | { |
75 | (void) cls; | ||
76 | (void) section; | 75 | (void) section; |
77 | fprintf (stdout, | 76 | const struct GNUNET_CONFIGURATION_Handle *cfg = cls; |
78 | "%s = %s\n", | 77 | char *value_fn; |
79 | option, | 78 | if (is_filename) |
80 | value); | 79 | { |
80 | GNUNET_assert (GNUNET_OK == | ||
81 | GNUNET_CONFIGURATION_get_value_filename (cfg, | ||
82 | section, | ||
83 | option, | ||
84 | &value_fn)); | ||
85 | fprintf (stdout, | ||
86 | "%s = %s\n", | ||
87 | option, | ||
88 | GNUNET_STRINGS_filename_expand (value_fn)); | ||
89 | } | ||
90 | else | ||
91 | { | ||
92 | fprintf (stdout, | ||
93 | "%s = %s\n", | ||
94 | option, | ||
95 | value); | ||
96 | } | ||
81 | } | 97 | } |
82 | 98 | ||
83 | 99 | ||
@@ -156,8 +172,8 @@ run (void *cls, | |||
156 | { | 172 | { |
157 | GNUNET_CONFIGURATION_iterate_section_values (cfg, | 173 | GNUNET_CONFIGURATION_iterate_section_values (cfg, |
158 | section, | 174 | section, |
159 | &print_option, | 175 | &print_option, |
160 | NULL); | 176 | (void *) cfg); |
161 | } | 177 | } |
162 | else | 178 | else |
163 | { | 179 | { |