diff options
author | Jilles Tjoelker <jilles@irssi.org> | 2009-08-13 21:16:22 +0000 |
---|---|---|
committer | jilles <jilles@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2009-08-13 21:16:22 +0000 |
commit | 3c30196ad4b7109c53611fe5017f832ccaa27973 (patch) | |
tree | 1d0c2826af9dbd505167803a5b7ea806359d82bd /src/fe-common | |
parent | 04097e168197c1bd280924bf3093ddf0eeeffbef (diff) | |
download | irssi-3c30196ad4b7109c53611fe5017f832ccaa27973.zip |
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
Diffstat (limited to 'src/fe-common')
-rw-r--r-- | src/fe-common/core/fe-log.c | 6 |
1 files changed, 4 insertions, 2 deletions
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); |