Allow ';' as a Maildir flags seperator

Isync uses this by default on Windows where ':' is an invalid character
in file names. Also try to preserve the existing separator character
when generating a new file name.
This commit is contained in:
Nick Gasson
2020-05-23 09:21:57 +08:00
parent 9030cfc657
commit f8fcb55f91
3 changed files with 15 additions and 11 deletions

View File

@ -263,7 +263,7 @@ cleanup_filename (char *fname)
/* replace control characters, slashes, and colons by '-' */
for (cur = fname; cur && *cur; cur = g_utf8_next_char (cur)) {
uc = g_utf8_get_char (cur);
if (g_unichar_iscntrl (uc) || uc == '/' || uc == ':')
if (g_unichar_iscntrl (uc) || uc == '/' || uc == ':' || uc == ';')
g_string_append_unichar (gstr, '-');
else
g_string_append_unichar (gstr, uc);