mu: improve filename escaping

Sanitize attachment-names by replacing all control characters, '/' and
':'' by '-', but leave spaces alone.
This commit is contained in:
djcb
2016-03-15 06:59:35 +02:00
parent c041ca39ed
commit 66f205f6c5

View File

@ -244,9 +244,9 @@ cleanup_filename (char *fname)
{ {
gchar *cur; gchar *cur;
/* remove slashes, spaces, colons... */ /* replace control characters, slashes,colons by a '-' */
for (cur = fname; *cur; ++cur) for (cur = fname; *cur; ++cur)
if (*cur == '/' || *cur == ' ' || *cur == ':') if (*cur < ' ' || *cur == '/' || *cur == ':')
*cur = '-'; *cur = '-';
} }