]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - windows/winmisc.c
Sanitise bad characters in log file names.
[PuTTY.git] / windows / winmisc.c
index ce0a0d1d2a55e7fb8d545817a5330afb057fe7d3..f2e4f223595b4b73d642df1648223f282583d85a 100644 (file)
@@ -71,6 +71,13 @@ Filename *filename_deserialise(void *vdata, int maxsize, int *used)
     return filename_from_str(data);
 }
 
+char filename_char_sanitise(char c)
+{
+    if (strchr("<>:\"/\\|?*", c))
+        return '.';
+    return c;
+}
+
 #ifndef NO_SECUREZEROMEMORY
 /*
  * Windows implementation of smemclr (see misc.c) using SecureZeroMemory.