From: Timo Sirainen Date: Wed, 26 May 2010 16:07:53 +0000 (+0100) Subject: lib-storage: Allow shared namespace prefix to use %variable modifiers. X-Git-Tag: 2.0.beta6~151 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=139cbf8d9e1cc0c65d985f525756fe47a7bfada6;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Allow shared namespace prefix to use %variable modifiers. --HG-- branch : HEAD --- diff --git a/src/lib-storage/index/shared/shared-storage.c b/src/lib-storage/index/shared/shared-storage.c index 636f2ecb21..f350f92a9c 100644 --- a/src/lib-storage/index/shared/shared-storage.c +++ b/src/lib-storage/index/shared/shared-storage.c @@ -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') {