Added error message when home is not a directory (bug #16772)

This commit is contained in:
Sebastien Helleu 2006-06-10 19:29:23 +00:00
parent 62059cb614
commit 08aa5570d8
16 changed files with 2896 additions and 2802 deletions

405
po/cs.po

File diff suppressed because it is too large Load Diff

405
po/de.po

File diff suppressed because it is too large Load Diff

405
po/es.po

File diff suppressed because it is too large Load Diff

407
po/fr.po

File diff suppressed because it is too large Load Diff

405
po/hu.po

File diff suppressed because it is too large Load Diff

405
po/ru.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -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))

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -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))