1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-04 00:33:13 +02:00

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
+205 -200
View File
File diff suppressed because it is too large Load Diff
+205 -200
View File
File diff suppressed because it is too large Load Diff
+205 -200
View File
File diff suppressed because it is too large Load Diff
+206 -201
View File
File diff suppressed because it is too large Load Diff
+205 -200
View File
File diff suppressed because it is too large Load Diff
+205 -200
View File
File diff suppressed because it is too large Load Diff
+205 -200
View File
File diff suppressed because it is too large Load Diff
+12
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))
+205 -200
View File
File diff suppressed because it is too large Load Diff
+205 -200
View File
File diff suppressed because it is too large Load Diff
+205 -200
View File
File diff suppressed because it is too large Load Diff
+206 -201
View File
File diff suppressed because it is too large Load Diff
+205 -200
View File
File diff suppressed because it is too large Load Diff
+205 -200
View File
File diff suppressed because it is too large Load Diff
+205 -200
View File
File diff suppressed because it is too large Load Diff
+12
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))