aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Bünger <buenger@mytum.de>2018-06-07 17:22:22 +0200
committerJulius Bünger <buenger@mytum.de>2018-06-07 17:23:34 +0200
commit2cdccc796f93117f5c74ec3b586f7654307b02e0 (patch)
treec4be16e903b451ec269c2e0eab1e183dc4f07ba7
parent7b56a05a27cfc5a5ef1403f616e2734cacc1597c (diff)
config: file name expansion in all -f cases
-rw-r--r--src/util/gnunet-config.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/src/util/gnunet-config.c b/src/util/gnunet-config.c
index 81e09fdbf8..c01528a450 100644
--- a/src/util/gnunet-config.c
+++ b/src/util/gnunet-config.c
@@ -72,12 +72,28 @@ print_option (void *cls,
const char *option,
const char *value)
{
- (void) cls;
(void) section;
- fprintf (stdout,
- "%s = %s\n",
- option,
- value);
+ const struct GNUNET_CONFIGURATION_Handle *cfg = cls;
+ char *value_fn;
+ if (is_filename)
+ {
+ GNUNET_assert (GNUNET_OK ==
+ GNUNET_CONFIGURATION_get_value_filename (cfg,
+ section,
+ option,
+ &value_fn));
+ fprintf (stdout,
+ "%s = %s\n",
+ option,
+ GNUNET_STRINGS_filename_expand (value_fn));
+ }
+ else
+ {
+ fprintf (stdout,
+ "%s = %s\n",
+ option,
+ value);
+ }
}
@@ -156,8 +172,8 @@ run (void *cls,
{
GNUNET_CONFIGURATION_iterate_section_values (cfg,
section,
- &print_option,
- NULL);
+ &print_option,
+ (void *) cfg);
}
else
{