From 092c2c714e085a66834127bfb1e841486fd4f54c Mon Sep 17 00:00:00 2001 From: Alessio Vanni Date: Mon, 26 Oct 2020 01:26:27 +0100 Subject: - fix '-c' in applications without base config --- src/util/configuration_loader.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/util/configuration_loader.c b/src/util/configuration_loader.c index 51af24a9f..a59477b25 100644 --- a/src/util/configuration_loader.c +++ b/src/util/configuration_loader.c @@ -63,14 +63,16 @@ GNUNET_CONFIGURATION_load (struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_free (ipath); } - if (GNUNET_SYSERR == - GNUNET_CONFIGURATION_load_from (cfg, - baseconfig)) + char *dname = GNUNET_STRINGS_filename_expand (baseconfig); + GNUNET_free (baseconfig); + + if (GNUNET_YES == GNUNET_DISK_directory_test (dname, GNUNET_YES) && + GNUNET_SYSERR == GNUNET_CONFIGURATION_load_from (cfg, dname)) { - GNUNET_free (baseconfig); + GNUNET_free (dname); return GNUNET_SYSERR; /* no configuration at all found */ } - GNUNET_free (baseconfig); + GNUNET_free (dname); if ((NULL != filename) && (GNUNET_OK != GNUNET_CONFIGURATION_parse (cfg, filename))) { -- cgit v1.2.3