summaryrefslogtreecommitdiff
path: root/src/fe-common
diff options
context:
space:
mode:
authorJilles Tjoelker <jilles@irssi.org>2007-11-18 21:33:11 +0000
committerjilles <jilles@dbcabf3a-b0e7-0310-adc4-f8d773084564>2007-11-18 21:33:11 +0000
commitd5ea8d7bbc215916d9aa97feac225454f582a3bf (patch)
tree8e097111a90393f43ef9f9ac21626cd306a27353 /src/fe-common
parent0efac764f6510a3c86b102e53ffa27998343c79e (diff)
downloadirssi-d5ea8d7bbc215916d9aa97feac225454f582a3bf.zip
autolog: do not create *.log, send it to <your nick>.log instead
*.log resulted from server notices to * (as sent by ratbox) for example, and was subsequently interpreted as a wildcard (note that only * alone is a wildcard for log targets). Bug #533 git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4645 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common')
-rw-r--r--src/fe-common/core/fe-log.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/fe-common/core/fe-log.c b/src/fe-common/core/fe-log.c
index c00997a6..594de125 100644
--- a/src/fe-common/core/fe-log.c
+++ b/src/fe-common/core/fe-log.c
@@ -460,6 +460,7 @@ static void autolog_open_check(SERVER_REC *server, const char *server_tag,
const char *target, int level)
{
char **targets, **tmp;
+ const char *deftarget;
/* FIXME: kind of a kludge, but we don't want to reopen logs when
we're parting the channel with /WINDOW CLOSE.. Maybe a small
@@ -469,10 +470,13 @@ static void autolog_open_check(SERVER_REC *server, const char *server_tag,
(autolog_level & level) == 0 || target == NULL || *target == '\0')
return;
+ deftarget = server->nick ? server->nick : "unknown";
+
/* there can be multiple targets separated with comma */
targets = g_strsplit(target, ",", -1);
for (tmp = targets; *tmp != NULL; tmp++)
- autolog_open(server, server_tag, *tmp);
+ autolog_open(server, server_tag,
+ strcmp(*tmp, "*") ? *tmp : deftarget);
g_strfreev(targets);
}