src/main.c (main): create MC home directory (~/.mc) if absent.
Этот коммит содержится в:
родитель
027168ce3d
Коммит
d0beb4cfec
13
src/main.c
13
src/main.c
@ -2121,6 +2121,9 @@ handle_args (int argc, char *argv[])
|
|||||||
int
|
int
|
||||||
main (int argc, char *argv[])
|
main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
struct stat s;
|
||||||
|
char *mc_dir;
|
||||||
|
|
||||||
/* We had LC_CTYPE before, LC_ALL includs LC_TYPE as well */
|
/* We had LC_CTYPE before, LC_ALL includs LC_TYPE as well */
|
||||||
setlocale (LC_ALL, "");
|
setlocale (LC_ALL, "");
|
||||||
bindtextdomain ("mc", LOCALEDIR);
|
bindtextdomain ("mc", LOCALEDIR);
|
||||||
@ -2181,6 +2184,16 @@ main (int argc, char *argv[])
|
|||||||
|
|
||||||
init_curses ();
|
init_curses ();
|
||||||
|
|
||||||
|
/* create home directory */
|
||||||
|
/* do it after the screen library initialization to show the error message */
|
||||||
|
mc_dir = concat_dir_and_file (home_dir, MC_BASE);
|
||||||
|
canonicalize_pathname (mc_dir);
|
||||||
|
if ((stat (mc_dir, &s) != 0) && (errno == ENOENT)
|
||||||
|
&& mkdir (mc_dir, 0755) != 0)
|
||||||
|
message (D_ERROR, _("Warning"),
|
||||||
|
_("Cannot create %s directory"), mc_dir);
|
||||||
|
g_free (mc_dir);
|
||||||
|
|
||||||
init_xterm_support ();
|
init_xterm_support ();
|
||||||
|
|
||||||
#ifdef HAVE_SUBSHELL_SUPPORT
|
#ifdef HAVE_SUBSHELL_SUPPORT
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user