commit 61383c66ea45ad4e17efce4c59441b35bae5ff25
parent f324ae742a2373282a7f61cb89348bc081233f9d
Author: Andrej Kacian <ticho@claws-mail.org>
Date: Fri, 22 Apr 2016 13:31:41 +0200
Disallow folder names ending with a space on Windows.
Closes bug #2781.
Diffstat:
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/folder.c b/src/folder.c
@@ -4820,6 +4820,10 @@ gboolean folder_local_name_ok(const gchar *name)
alertpanel_error(_("A folder name cannot begin or end with a dot."));
return FALSE;
}
+ if (name[strlen(name) - 1] == ' ') {
+ alertpanel_error(_("A folder name can not end with a space."));
+ return FALSE;
+ }
#endif
return TRUE;
diff --git a/src/plugins/rssyl/rssyl_subscribe.c b/src/plugins/rssyl/rssyl_subscribe.c
@@ -129,11 +129,14 @@ gboolean rssyl_subscribe(FolderItem *parent, const gchar *url,
tmpname2 = g_strdup(tmpname);
#ifdef G_OS_WIN32
- /* Windows does not allow its filenames to start or end with a dot. */
+ /* Windows does not allow its filenames to start or end with a dot,
+ * or to end with a space. */
if (tmpname2[0] == '.')
tmpname2[0] = "_";
if (tmpname2[strlen(tmpname2) - 1] == '.')
tmpname2[strlen(tmpname2) - 1] = '_';
+ if (tmpname2[strlen(tmpname2) - 1] == ' ')
+ tmpname2[strlen(tmpname2) - 1] == '_';
#endif
while (folder_find_child_item_by_name(parent, tmpname2) != 0 && i < 20) {