Mercurial > dovecot > original-hg > dovecot-1.2
diff src/lib-storage/index/shared/shared-storage.c @ 8446:1c13cf0f8bb5 HEAD
Added mail_namespace_destroy().
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Wed, 19 Nov 2008 18:45:46 +0200 |
parents | 118e07fdfe11 |
children | 4cf249042df6 |
line wrap: on
line diff
--- a/src/lib-storage/index/shared/shared-storage.c Wed Nov 19 18:19:13 2008 +0200 +++ b/src/lib-storage/index/shared/shared-storage.c Wed Nov 19 18:45:46 2008 +0200 @@ -45,6 +45,7 @@ struct shared_storage *storage = (struct shared_storage *)_storage; struct mailbox_list_settings list_set; const char *driver, *p; + char *wildcardp; bool have_username; /* data must begin with the actual mailbox driver */ @@ -63,14 +64,13 @@ } _storage->mailbox_is_file = storage->storage_class->mailbox_is_file; - p = strchr(_storage->ns->prefix, '%'); - if (p == NULL) { + wildcardp = strchr(_storage->ns->prefix, '%'); + if (wildcardp == NULL) { *error_r = "Shared namespace prefix doesn't contain %"; return -1; } - storage->ns_prefix_pattern = p_strdup(_storage->pool, p); - _storage->ns->prefix = p_strdup_until(_storage->ns->user->pool, - _storage->ns->prefix, p); + storage->ns_prefix_pattern = p_strdup(_storage->pool, wildcardp); + *wildcardp = '\0'; have_username = FALSE; for (p = storage->ns_prefix_pattern; *p != '\0'; p++) { @@ -265,10 +265,10 @@ } /* create the new namespace */ - ns = p_new(user->pool, struct mail_namespace, 1); + ns = i_new(struct mail_namespace, 1); ns->type = NAMESPACE_SHARED; ns->user = user; - ns->prefix = p_strdup(user->pool, str_c(prefix)); + ns->prefix = i_strdup(str_c(prefix)); ns->flags = NAMESPACE_FLAG_LIST | NAMESPACE_FLAG_HIDDEN | NAMESPACE_FLAG_AUTOCREATED; ns->sep = _storage->ns->sep;