(mc_config_get_string): use mc_config_get_string_raw()

...to get rid of code duplcation.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2022-05-14 15:36:37 +03:00
parent bae55d637a
commit 4008d3b96c
1 changed files with 1 additions and 13 deletions

View File

@ -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;