From 3c30196ad4b7109c53611fe5017f832ccaa27973 Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Thu, 13 Aug 2009 21:16:22 +0000 Subject: autolog: change some characters illegal in Windows filenames to underscores git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5085 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-common/core/fe-log.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/fe-common') diff --git a/src/fe-common/core/fe-log.c b/src/fe-common/core/fe-log.c index c7cf3aed..8e250028 100644 --- a/src/fe-common/core/fe-log.c +++ b/src/fe-common/core/fe-log.c @@ -393,14 +393,14 @@ static void autologs_close_all(void) } } -/* '%' -> '%%', '/' -> '_' */ +/* '%' -> '%%', badness -> '_' */ static char *escape_target(const char *target) { char *str, *p; p = str = g_malloc(strlen(target)*2+1); while (*target != '\0') { - if (*target == '/') + if (strchr("/\\|*?\"<>:", *target)) *p++ = '_'; else { if (*target == '%') @@ -429,6 +429,8 @@ static void autolog_open(SERVER_REC *server, const char *server_tag, /* '/' -> '_' - don't even accidentally try to log to #../../../file if you happen to join to such channel.. + similar for some characters that are metacharacters + and/or illegal in Windows filenames. '%' -> '%%' - so strftime() won't mess with them */ fixed_target = escape_target(target); -- cgit v1.2.3