From 45c9838141a9ef15d718d07a908d97d90dd5aa15 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sat, 25 Nov 2000 16:30:56 +0000 Subject: [PATCH] Time formats didn't work in directory name of autologs. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@866 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/core/log.c | 1 + src/fe-common/core/fe-log.c | 13 +++++-------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/core/log.c b/src/core/log.c index 9617b0c5..112e46b6 100644 --- a/src/core/log.c +++ b/src/core/log.c @@ -348,6 +348,7 @@ LOG_REC *log_create_rec(const char *fname, int level) if (rec == NULL) { rec = g_new0(LOG_REC, 1); rec->fname = g_strdup(fname); + rec->real_fname = log_filename(rec); rec->handle = -1; } diff --git a/src/fe-common/core/fe-log.c b/src/fe-common/core/fe-log.c index 95ab07e4..8250dd90 100644 --- a/src/fe-common/core/fe-log.c +++ b/src/fe-common/core/fe-log.c @@ -342,7 +342,7 @@ static void autologs_close_all(void) static void autolog_open(void *server, const char *target) { LOG_REC *log; - char *fname, *dir, *str; + char *fname, *dir; log = logs_find_item(LOG_ITEM_TARGET, target, server, NULL); if (log != NULL && !log->failed) { @@ -352,16 +352,13 @@ static void autolog_open(void *server, const char *target) fname = parse_special_string(autolog_path, server, NULL, target, NULL); if (log_find(fname) == NULL) { - str = convert_home(fname); - dir = g_dirname(str); - g_free(str); - - mkpath(dir, LOG_DIR_CREATE_MODE); - g_free(dir); - log = log_create_rec(fname, autolog_level); log_item_add(log, LOG_ITEM_TARGET, target, server); + dir = g_dirname(log->real_fname); + mkpath(dir, LOG_DIR_CREATE_MODE); + g_free(dir); + log->temp = TRUE; log_update(log); log_start_logging(log);