summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorTingPing <tingping@tingping.se>2014-01-26 06:50:29 -0500
committerTingPing <tingping@tingping.se>2014-01-26 06:55:38 -0500
commit35e84f6edc059909e8168a6929dcb21ffbe6930a (patch)
tree5ec04287a892553578ba333ed32330f4d31cf7f5 /src
parent7fcf70c5393a54a971049e118be2757e2e205567 (diff)
Show error when you lack write permissions to configdir
Diffstat (limited to 'src')
-rw-r--r--src/common/hexchat.c14
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 */