mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
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
This commit is contained in:
parent
d1d70fd5d7
commit
45c9838141
@ -348,6 +348,7 @@ LOG_REC *log_create_rec(const char *fname, int level)
|
|||||||
if (rec == NULL) {
|
if (rec == NULL) {
|
||||||
rec = g_new0(LOG_REC, 1);
|
rec = g_new0(LOG_REC, 1);
|
||||||
rec->fname = g_strdup(fname);
|
rec->fname = g_strdup(fname);
|
||||||
|
rec->real_fname = log_filename(rec);
|
||||||
rec->handle = -1;
|
rec->handle = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -342,7 +342,7 @@ static void autologs_close_all(void)
|
|||||||
static void autolog_open(void *server, const char *target)
|
static void autolog_open(void *server, const char *target)
|
||||||
{
|
{
|
||||||
LOG_REC *log;
|
LOG_REC *log;
|
||||||
char *fname, *dir, *str;
|
char *fname, *dir;
|
||||||
|
|
||||||
log = logs_find_item(LOG_ITEM_TARGET, target, server, NULL);
|
log = logs_find_item(LOG_ITEM_TARGET, target, server, NULL);
|
||||||
if (log != NULL && !log->failed) {
|
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);
|
fname = parse_special_string(autolog_path, server, NULL, target, NULL);
|
||||||
if (log_find(fname) == 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 = log_create_rec(fname, autolog_level);
|
||||||
log_item_add(log, LOG_ITEM_TARGET, target, server);
|
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->temp = TRUE;
|
||||||
log_update(log);
|
log_update(log);
|
||||||
log_start_logging(log);
|
log_start_logging(log);
|
||||||
|
Loading…
Reference in New Issue
Block a user