From 202e0c0997a3974e68c526d242db3962263d3226 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 11 Jun 2010 13:40:49 +0000 Subject: simplify --- src/util/configuration.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/util/configuration.c b/src/util/configuration.c index a244d5f01..d033e0a72 100644 --- a/src/util/configuration.c +++ b/src/util/configuration.c @@ -804,26 +804,20 @@ GNUNET_CONFIGURATION_get_value_filename (const struct const char *section, const char *option, char **value) { - int ret; char *tmp; - tmp = NULL; - ret = GNUNET_CONFIGURATION_get_value_string (cfg, section, option, &tmp); - if (ret == GNUNET_SYSERR) - return ret; - if (tmp != NULL) - { - tmp = GNUNET_CONFIGURATION_expand_dollar (cfg, tmp); - *value = GNUNET_STRINGS_filename_expand (tmp); - GNUNET_free (tmp); - if (*value == NULL) - ret = GNUNET_SYSERR; - } - else + if (GNUNET_OK != + GNUNET_CONFIGURATION_get_value_string (cfg, section, option, &tmp)) { *value = NULL; + return GNUNET_SYSERR; } - return ret; + tmp = GNUNET_CONFIGURATION_expand_dollar (cfg, tmp); + *value = GNUNET_STRINGS_filename_expand (tmp); + GNUNET_free (tmp); + if (*value == NULL) + return GNUNET_SYSERR; + return GNUNET_OK; } -- cgit v1.2.3