Added error message when home is not a directory (bug #16772)
This commit is contained in:
parent
62059cb614
commit
08aa5570d8
405
po/weechat.pot
405
po/weechat.pot
File diff suppressed because it is too large
Load Diff
@ -693,6 +693,7 @@ weechat_create_home_dirs ()
|
||||
{
|
||||
char *ptr_home;
|
||||
int dir_length;
|
||||
struct stat statinfo;
|
||||
|
||||
if (!weechat_home)
|
||||
{
|
||||
@ -715,6 +716,17 @@ weechat_create_home_dirs ()
|
||||
snprintf (weechat_home, dir_length, "%s%s.weechat", ptr_home,
|
||||
DIR_SEPARATOR);
|
||||
}
|
||||
|
||||
/* if home already exists, it has to be a directory */
|
||||
if (stat (weechat_home, &statinfo) == 0)
|
||||
{
|
||||
if (!S_ISDIR (statinfo.st_mode))
|
||||
{
|
||||
fprintf (stderr, _("%s home (%s) is not a directory\n"),
|
||||
WEECHAT_ERROR, weechat_home);
|
||||
weechat_shutdown (EXIT_FAILURE, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/* create home directory; error is fatal */
|
||||
if (!weechat_create_dir (weechat_home))
|
||||
|
405
weechat/po/cs.po
405
weechat/po/cs.po
File diff suppressed because it is too large
Load Diff
405
weechat/po/de.po
405
weechat/po/de.po
File diff suppressed because it is too large
Load Diff
405
weechat/po/es.po
405
weechat/po/es.po
File diff suppressed because it is too large
Load Diff
407
weechat/po/fr.po
407
weechat/po/fr.po
File diff suppressed because it is too large
Load Diff
405
weechat/po/hu.po
405
weechat/po/hu.po
File diff suppressed because it is too large
Load Diff
405
weechat/po/ru.po
405
weechat/po/ru.po
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -693,6 +693,7 @@ weechat_create_home_dirs ()
|
||||
{
|
||||
char *ptr_home;
|
||||
int dir_length;
|
||||
struct stat statinfo;
|
||||
|
||||
if (!weechat_home)
|
||||
{
|
||||
@ -715,6 +716,17 @@ weechat_create_home_dirs ()
|
||||
snprintf (weechat_home, dir_length, "%s%s.weechat", ptr_home,
|
||||
DIR_SEPARATOR);
|
||||
}
|
||||
|
||||
/* if home already exists, it has to be a directory */
|
||||
if (stat (weechat_home, &statinfo) == 0)
|
||||
{
|
||||
if (!S_ISDIR (statinfo.st_mode))
|
||||
{
|
||||
fprintf (stderr, _("%s home (%s) is not a directory\n"),
|
||||
WEECHAT_ERROR, weechat_home);
|
||||
weechat_shutdown (EXIT_FAILURE, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/* create home directory; error is fatal */
|
||||
if (!weechat_create_dir (weechat_home))
|
||||
|
Loading…
x
Reference in New Issue
Block a user