changeset 9575:0a00dcc4f0ea HEAD

lib-storage: Allow shared namespace prefix to use %variable modifiers.
author Timo Sirainen <tss@iki.fi>
date Wed, 26 May 2010 17:07:51 +0100
parents e63d38c7d2ba
children eaba4cfeaa44
files src/lib-storage/index/shared/shared-storage.c
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/shared/shared-storage.c	Tue May 25 17:37:28 2010 +0100
+++ b/src/lib-storage/index/shared/shared-storage.c	Wed May 26 17:07:51 2010 +0100
@@ -44,7 +44,7 @@
 	struct shared_storage *storage = (struct shared_storage *)_storage;
 	struct mailbox_list_settings list_set;
 	const char *driver, *p;
-	char *wildcardp;
+	char *wildcardp, key;
 	bool have_username;
 
 	/* data must begin with the actual mailbox driver */
@@ -74,11 +74,11 @@
 	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') {