Mercurial > ~mikael > mcabber > hg
diff mcabber/src/histolog.c @ 1167:9726c78a91f3
Allow '~' (HOME directory) in config options
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sun, 18 Feb 2007 11:03:49 +0100 |
parents | 3b9bbf6c4c93 |
children | e802ec0c02d2 |
line wrap: on
line diff
--- a/mcabber/src/histolog.c Sat Feb 17 15:14:39 2007 +0100 +++ b/mcabber/src/histolog.c Sun Feb 18 11:03:49 2007 +0100 @@ -309,17 +309,21 @@ if (enable || loadfiles) { if (root_dir) { + char *xp_root_dir; int l = strlen(root_dir); if (l < 1) { scr_LogPrint(LPRINT_LOGNORM, "Error: logging dir name too short"); UseFileLogging = FileLoadLogs = FALSE; return; } + xp_root_dir = expand_filename(root_dir); // RootDir must be slash-terminated - if (root_dir[l-1] == '/') - RootDir = g_strdup(root_dir); - else - RootDir = g_strdup_printf("%s/", root_dir); + if (root_dir[l-1] == '/') { + RootDir = xp_root_dir; + } else { + RootDir = g_strdup_printf("%s/", xp_root_dir); + g_free(xp_root_dir); + } } else { char *home = getenv("HOME"); const char *dir = "/.mcabber/histo/";