From f28ec51c77bb165a89c8e14abf5deb454e8233bb Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Mon, 14 Feb 2011 14:10:33 +0300 Subject: [PATCH] (mc_config_init): don't drop file name if file is not exist. Signed-off-by: Andrew Borodin --- lib/mcconfig/common.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/mcconfig/common.c b/lib/mcconfig/common.c index fee93cafc..a4c97318a 100644 --- a/lib/mcconfig/common.c +++ b/lib/mcconfig/common.c @@ -112,14 +112,12 @@ mc_config_init (const gchar * ini_path) g_free (mc_config); return NULL; } - if (!ini_path || !exist_file (ini_path)) - { + if (ini_path == NULL) return mc_config; - } - if (!mc_stat (ini_path, &st) && st.st_size) + if (exist_file (ini_path) && mc_stat (ini_path, &st) == 0 && st.st_size != 0) { - /* file present and not empty */ + /* file exists and not empty */ g_key_file_load_from_file (mc_config->handle, ini_path, G_KEY_FILE_KEEP_COMMENTS, NULL); } -- 2.11.4.GIT