]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Allow shared namespace prefix to use %variable modifiers.
authorTimo Sirainen <tss@iki.fi>
Wed, 26 May 2010 16:07:53 +0000 (17:07 +0100)
committerTimo Sirainen <tss@iki.fi>
Wed, 26 May 2010 16:07:53 +0000 (17:07 +0100)
--HG--
branch : HEAD

src/lib-storage/index/shared/shared-storage.c

index 636f2ecb213ec37574ba67bf8ad9075a22cd7232..f350f92a9c78d743349d9a2b90673d0e313470a1 100644 (file)
@@ -31,7 +31,7 @@ shared_storage_create(struct mail_storage *_storage, struct mail_namespace *ns,
 {
        struct shared_storage *storage = (struct shared_storage *)_storage;
        const char *driver, *p;
-       char *wildcardp;
+       char *wildcardp, key;
        bool have_username;
 
        /* location must begin with the actual mailbox driver */
@@ -61,11 +61,11 @@ shared_storage_create(struct mail_storage *_storage, struct mail_namespace *ns,
        for (p = storage->ns_prefix_pattern; *p != '\0'; p++) {
                if (*p != '%')
                        continue;
-               if (*++p == '\0')
-                       break;
-               if (*p == 'u' || *p == 'n')
+
+               key = var_get_key(p + 1);
+               if (key == 'u' || key == 'n')
                        have_username = TRUE;
-               else if (*p != '%' && *p != 'd')
+               else if (key != '%' && key != 'd')
                        break;
        }
        if (*p != '\0') {