Do not hardcode the default logging location
The current configuration directory is used as a base.
--- a/mcabber/mcabber/histolog.c Sat Oct 17 20:17:30 2015 +0200
+++ b/mcabber/mcabber/histolog.c Sat Oct 17 20:19:58 2015 +0200
@@ -358,7 +358,8 @@
}
// hlog_enable()
-// Enable logging to files. If root_dir is NULL, then $HOME/.mcabber is used.
+// Enable logging to files. If root_dir is NULL, then the subdirectory "histo"
+// in mcabber configuration directory is used.
// If loadfiles is TRUE, we will try to load buddies history logs from file.
void hlog_enable(guint enable, const char *root_dir, guint loadfiles)
{
@@ -383,9 +384,9 @@
g_free(xp_root_dir);
}
} else {
- char *home = getenv("HOME");
- const char *dir = "/.mcabber/histo/";
- RootDir = g_strdup_printf("%s%s", home, dir);
+ const char *cfgdir = settings_get_mcabber_config_dir();
+ const char *hdir = "/histo/";
+ RootDir = g_strdup_printf("%s%s", cfgdir, hdir);
}
// Check directory permissions (should not be readable by group/others)
if (checkset_perm(RootDir, TRUE) == -1) {