mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 10:04:32 +03:00
(mc_config_init): don't drop file name if file is not exist.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
04d54931d0
commit
f28ec51c77
@ -112,14 +112,12 @@ mc_config_init (const gchar * ini_path)
|
|||||||
g_free (mc_config);
|
g_free (mc_config);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (!ini_path || !exist_file (ini_path))
|
if (ini_path == NULL)
|
||||||
{
|
|
||||||
return mc_config;
|
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);
|
g_key_file_load_from_file (mc_config->handle, ini_path, G_KEY_FILE_KEEP_COMMENTS, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user