summaryrefslogtreecommitdiff
path: root/logging.c
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2019-09-16 19:42:04 +0100
committerLuke Bratch <luke@bratch.co.uk>2019-09-16 19:42:04 +0100
commit7a3a8aa2a521f752a042ede37b81125689aa0067 (patch)
tree102028a6866a1f95ec3694ef521a5724ae4fee7e /logging.c
parenta37c6010340f3bc755fcd7c54da13daea7645e42 (diff)
Make all log filenames lowercase - since IRC nicks and channel names are case-insensitive, we can ensure a nick/channel with varying case always ends up in the same log file.
Diffstat (limited to 'logging.c')
-rw-r--r--logging.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/logging.c b/logging.c
index db3fbfb..b000c28 100644
--- a/logging.c
+++ b/logging.c
@@ -114,6 +114,11 @@ int logline(char *str, struct ircdstate *ircdstate, char *basedir, int type) {
debugprint(DEBUG_CRIT, "Filename would be too long if logging either '%s', '%s' or '%s', returning!\n", from, to, ircdname);
return 0;
}
+ // Make the filename lowercase (since IRC nicks and channel names are case-insensitive,
+ // we can ensure a nick/channel with varying case always ends up in the same log file)
+ strlower(from);
+ strlower(to);
+ strlower(ircdname);
switch(type) {
case LOG_PRIVMSG: