]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Fixes for inbox case-insensitity matching
authorTimo Sirainen <tss@iki.fi>
Sat, 26 Jul 2003 23:28:05 +0000 (02:28 +0300)
committerTimo Sirainen <tss@iki.fi>
Sat, 26 Jul 2003 23:28:05 +0000 (02:28 +0300)
--HG--
branch : HEAD

src/lib-imap/imap-match.c

index 713975c6a8dc983c3dc7d45f3773f80c92a38b17..87a82f851adeb7461904a8a50997de1e3293874b 100644 (file)
@@ -61,7 +61,8 @@ imap_match_init(pool_t pool, const char *mask, int inboxcase, char separator)
                /* check if we could be comparing INBOX. */
                inboxp = inbox;
                glob->inboxcase = TRUE;
-               for (p = glob->mask; *p != '\0' && *p != '*'; p++) {
+                p = glob->mask;
+               for (; *p != '\0' && *p != '*' && *p != separator; p++) {
                        if (*p != '%') {
                                inboxp = strchr(inboxp, i_toupper(*p));
                                if (inboxp == NULL) {
@@ -74,16 +75,12 @@ imap_match_init(pool_t pool, const char *mask, int inboxcase, char separator)
                                           any invalid chars */
                                        if (*++p == '%') p++;
                                        if (*p != '\0' && *p != '*' &&
-                                           *p != glob->sep_char)
+                                           *p != separator)
                                                glob->inboxcase = FALSE;
                                        break;
                                }
                        }
                }
-
-               if (glob->inboxcase && inboxp != NULL && *inboxp != '\0' &&
-                   *p != '*' && (p != glob->mask && p[-1] != '%'))
-                       glob->inboxcase = FALSE;
        }
 
        return glob;