Mercurial > hg
comparison mcabber/mcabber/histolog.c @ 2253:5a107c907e71
Read $HOME/.mcabberrc if there is no mcabber configuration directory
This was broken by ccd4ffa41a1b.
This patch should fix issue #146.
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sat, 27 Feb 2016 11:28:24 +0100 |
parents | 2c7cca6dec6a |
children | 1cc88b0efdb9 |
comparison
equal
deleted
inserted
replaced
2252:2c7cca6dec6a | 2253:5a107c907e71 |
---|---|
395 g_free(xp_root_dir); | 395 g_free(xp_root_dir); |
396 } | 396 } |
397 } else { | 397 } else { |
398 const char *cfgdir = settings_get_mcabber_config_dir(); | 398 const char *cfgdir = settings_get_mcabber_config_dir(); |
399 const char *hdir = "/histo/"; | 399 const char *hdir = "/histo/"; |
400 if (!cfgdir) { | |
401 scr_LogPrint(LPRINT_LOGNORM, "ERROR: Cannot find out " | |
402 "history log directory; logging DISABLED"); | |
403 UseFileLogging = FileLoadLogs = FALSE; | |
404 return; | |
405 } | |
400 RootDir = g_strdup_printf("%s%s", cfgdir, hdir); | 406 RootDir = g_strdup_printf("%s%s", cfgdir, hdir); |
401 } | 407 } |
402 | 408 |
403 // Check directory permissions (should not be readable by group/others) | 409 // Check directory permissions (should not be readable by group/others) |
404 if (checkset_perm(RootDir, TRUE) == -1) { | 410 if (checkset_perm(RootDir, TRUE) == -1) { |
405 // The directory does not actually exists | 411 // The directory does not actually exists |
406 g_free(RootDir); | 412 g_free(RootDir); |
407 RootDir = NULL; | 413 RootDir = NULL; |
408 scr_LogPrint(LPRINT_LOGNORM, "ERROR: Cannot access " | 414 scr_LogPrint(LPRINT_LOGNORM, "ERROR: Cannot access " |
409 "history log directory, logging DISABLED"); | 415 "history log directory; logging DISABLED"); |
410 UseFileLogging = FileLoadLogs = FALSE; | 416 UseFileLogging = FileLoadLogs = FALSE; |
411 } | 417 } |
412 } | 418 } |
413 | 419 |
414 guint hlog_is_enabled(void) | 420 guint hlog_is_enabled(void) |