diff --git a/wmud/main.c b/wmud/main.c index 7aef745..a2472e2 100644 --- a/wmud/main.c +++ b/wmud/main.c @@ -200,7 +200,6 @@ main(int argc, char **argv) GError *err = NULL; GSList *game_menu = NULL; WmudConfiguration *current_config = NULL; - gchar *filename = NULL; g_log_set_handler(G_LOG_DOMAIN, G_LOG_LEVEL_MASK, wmud_logger, NULL); @@ -214,12 +213,8 @@ main(int argc, char **argv) /* TODO: Create signal handlers! */ - if ((filename = wmud_configuration_get_filename(current_config)) == NULL) { - filename = WMUD_CONFDIR "/wmud.conf"; - } - // Process configuration file - wmud_configuration_update_from_file(current_config, filename, NULL); + wmud_configuration_update_from_file(current_config, NULL, NULL); if (!wmud_config_init(&active_config, &err)) { if (err) { diff --git a/wmud/wmud-configuration.c b/wmud/wmud-configuration.c index 48cec2b..f0c383c 100644 --- a/wmud/wmud-configuration.c +++ b/wmud/wmud-configuration.c @@ -98,8 +98,12 @@ wmud_configuration_update_from_file(WmudConfiguration *configuration, WmudConfigurationPrivate *priv = wmud_configuration_get_instance_private( configuration); - // Save the file name for possible later use - priv->file_name = g_strdup(filename); + if (filename != NULL) { + g_free(priv->file_name); + priv->file_name = g_strdup(filename); + } else if (priv->file_name == NULL) { + priv->file_name = g_strdup(WMUD_CONFDIR "/wmud.conf"); + } priv->key_file = g_key_file_new();