* Properly detect invalid windows folder names. Thx to djcb for the great catch
authorSergio Villar Senin <svillar@igalia.com>
Mon, 4 Aug 2008 08:12:48 +0000 (08:12 +0000)
committerSergio Villar Senin <svillar@igalia.com>
Mon, 4 Aug 2008 08:12:48 +0000 (08:12 +0000)
pmo-trunk-r5248

src/modest-text-utils.c

index e2802d8..b5e3c00 100644 (file)
@@ -1373,10 +1373,8 @@ modest_text_utils_validate_folder_name (const gchar *folder_name)
 
        /* Cannot contain Windows port numbers. I'd like to use GRegex
           but it's still not available in Maemo. sergio */
-       if (g_str_has_prefix (folder_name, "LTP") ||
-           g_str_has_prefix (folder_name, "ltp") ||
-           g_str_has_prefix (folder_name, "COM") ||
-           g_str_has_prefix (folder_name, "com")) {
+       if (g_ascii_strncasecmp (folder_name, "LPT", 3) ||
+           g_ascii_strncasecmp (folder_name, "COM", 3)) {
                glong val;
                gchar *endptr;