mirror of
https://github.com/moparisthebest/hexchat
synced 2024-11-22 17:22:18 -05:00
Don't hardcode path when printing error message for config dir creation
This commit is contained in:
parent
ec301a5a54
commit
52175f439a
@ -359,26 +359,21 @@ static void
|
||||
check_prefs_dir (void)
|
||||
{
|
||||
char *dir = get_xdir_fs ();
|
||||
static char *msg = NULL;
|
||||
|
||||
if (access (dir, F_OK) != 0)
|
||||
{
|
||||
#ifdef WIN32
|
||||
if (mkdir (dir) != 0)
|
||||
{
|
||||
if (portable_mode ())
|
||||
{
|
||||
fe_message (_("Cannot create .\\config"), FE_MSG_ERROR);
|
||||
}
|
||||
else
|
||||
{
|
||||
fe_message (_("Cannot create %APPDATA%\\HexChat"), FE_MSG_ERROR);
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (mkdir (dir, S_IRUSR | S_IWUSR | S_IXUSR) != 0)
|
||||
{
|
||||
fe_message (_("Cannot create ~/.config/hexchat"), FE_MSG_ERROR);
|
||||
}
|
||||
#endif
|
||||
{
|
||||
msg = malloc (strlen (get_xdir_fs ()) + 15);
|
||||
sprintf (msg, "Cannot create %s", get_xdir_fs ());
|
||||
fe_message (msg, FE_MSG_ERROR);
|
||||
free (msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user