mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 18:14:25 +03:00
Show error and don't start if config directory is a regular file
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
parent
6b2c8d4800
commit
29ba0a0cda
@ -26,6 +26,7 @@
|
||||
#include <config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "lib/global.h"
|
||||
@ -151,8 +152,18 @@ mc_config_init_one_config_path (const char *path_base, const char *subdir, GErro
|
||||
|
||||
full_path = g_build_filename (path_base, subdir, NULL);
|
||||
|
||||
if (g_file_test (full_path, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))
|
||||
config_dir_present = TRUE;
|
||||
if (g_file_test (full_path, G_FILE_TEST_EXISTS))
|
||||
{
|
||||
if (g_file_test (full_path, G_FILE_TEST_IS_DIR))
|
||||
{
|
||||
config_dir_present = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf (stderr, "%s %s\n", _("FATAL: not a directory:"), full_path);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
mc_config_mkdir (full_path, error);
|
||||
if (error != NULL && *error != NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user