From 4008d3b96cf80b0a845a10d448b6dbc978534070 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sat, 14 May 2022 15:36:37 +0300 Subject: [PATCH] (mc_config_get_string): use mc_config_get_string_raw() ...to get rid of code duplcation. Signed-off-by: Andrew Borodin --- lib/mcconfig/get.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/lib/mcconfig/get.c b/lib/mcconfig/get.c index e30185912..c2703d3ff 100644 --- a/lib/mcconfig/get.c +++ b/lib/mcconfig/get.c @@ -94,19 +94,7 @@ mc_config_get_string (mc_config_t * mc_config, const gchar * group, gchar *ret; estr_t conv_res; - if (mc_config == NULL || group == NULL || param == NULL) - return g_strdup (def); - - if (!mc_config_has_param (mc_config, group, param)) - { - if (def != NULL) - mc_config_set_string (mc_config, group, param, def); - return g_strdup (def); - } - - ret = g_key_file_get_string (mc_config->handle, group, param, NULL); - if (ret == NULL) - ret = g_strdup (def); + ret = mc_config_get_string_raw (mc_config, group, param, def); if (mc_global.utf8_display) return ret;