From 2cdccc796f93117f5c74ec3b586f7654307b02e0 Mon Sep 17 00:00:00 2001 From: Julius Bünger Date: Thu, 7 Jun 2018 17:22:22 +0200 Subject: config: file name expansion in all -f cases --- src/util/gnunet-config.c | 30 +++++++++++++++++++++++------- 1 file 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 { -- cgit v1.2.3-18-g5258