summaryrefslogtreecommitdiff
path: root/src/fe-common
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-03-16 13:28:20 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-03-16 13:28:20 +0000
commitee3a30e16b44f6a8f1dc9cda1c7f5802a0a5c84c (patch)
tree6a4c6a2a442c0050acd6eb360126e3fb14912d7b /src/fe-common
parent665ad121a8a7add9144eb11f3b88dffcbfadfe36 (diff)
downloadirssi-ee3a30e16b44f6a8f1dc9cda1c7f5802a0a5c84c.zip
$1 can now be used as server tag in /SET autolog_path. This is useful when
you want to log for specified tag before the server exists yet so $tag wouldn't work. This happens at least when queries print the "querying nick" text at startup. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2622 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common')
-rw-r--r--src/fe-common/core/fe-log.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/fe-common/core/fe-log.c b/src/fe-common/core/fe-log.c
index e7b4ae53..bebff7f5 100644
--- a/src/fe-common/core/fe-log.c
+++ b/src/fe-common/core/fe-log.c
@@ -407,7 +407,7 @@ static void autolog_open(SERVER_REC *server, const char *server_tag,
const char *target)
{
LOG_REC *log;
- char *fname, *dir, *fixed_target;
+ char *fname, *dir, *fixed_target, *params;
log = logs_find_item(LOG_ITEM_TARGET, target, server_tag, NULL);
if (log != NULL && !log->failed) {
@@ -423,10 +423,14 @@ static void autolog_open(SERVER_REC *server, const char *server_tag,
if (CHAT_PROTOCOL(server)->case_insensitive)
g_strdown(fixed_target);
- fname = parse_special_string(autolog_path, server, NULL,
- fixed_target, NULL, 0);
+ /* $0 = target, $1 = server tag */
+ params = g_strconcat(fixed_target, " ", server_tag, NULL);
g_free(fixed_target);
+ fname = parse_special_string(autolog_path, server, NULL,
+ params, NULL, 0);
+ g_free(params);
+
if (log_find(fname) == NULL) {
log = log_create_rec(fname, autolog_level);
if (!settings_get_bool("autolog_colors"))