diff options
author | TingPing <tingping@tingping.se> | 2014-01-26 06:50:29 -0500 |
---|---|---|
committer | TingPing <tingping@tingping.se> | 2014-01-26 06:55:38 -0500 |
commit | 35e84f6edc059909e8168a6929dcb21ffbe6930a (patch) | |
tree | 5ec04287a892553578ba333ed32330f4d31cf7f5 /src | |
parent | 7fcf70c5393a54a971049e118be2757e2e205567 (diff) |
Show error when you lack write permissions to configdir
Diffstat (limited to 'src')
-rw-r--r-- | src/common/hexchat.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/common/hexchat.c b/src/common/hexchat.c index d066cd47..d44fa2f4 100644 --- a/src/common/hexchat.c +++ b/src/common/hexchat.c @@ -1089,7 +1089,7 @@ main (int argc, char *argv[]) { /* this is probably the first run */ load_default_config (); - make_config_dirs (); /* FIXME: if this fail display an error (?) */ + make_config_dirs (); make_dcc_dirs (); } @@ -1114,6 +1114,18 @@ main (int argc, char *argv[]) fe_init (); + /* This is done here because cfgfiles.c is too early in + * the startup process to use gtk functions. */ + if (g_access (get_xdir (), W_OK) != 0) + { + char buf[2048]; + + g_snprintf (buf, sizeof(buf), + _("You do not have write access to %s. Nothing from this session can be saved."), + get_xdir ()); + fe_message (buf, FE_MSG_ERROR); + } + #ifndef WIN32 #ifndef __EMX__ /* OS/2 uses UID 0 all the time */ |