]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
layout=fs: Fixes to mail_shared_explicit_inbox=no
authorTimo Sirainen <tss@iki.fi>
Mon, 7 May 2012 22:22:32 +0000 (01:22 +0300)
committerTimo Sirainen <tss@iki.fi>
Mon, 7 May 2012 22:22:32 +0000 (01:22 +0300)
src/lib-storage/list/mailbox-list-fs-iter.c

index 58b83622ccb9a356fbdad1909309c2093f9d6d32..5b660a5bb6e256a1281d7ee69878a541d22a15de 100644 (file)
@@ -123,7 +123,8 @@ dir_get_storage_name(struct list_dir_context *dir, const char *fname)
                return t_strconcat("/", fname, NULL);
        } else {
                /* child */
-               return t_strconcat(dir->storage_name, "/", fname, NULL);
+               return *fname == '\0' ? dir->storage_name :
+                       t_strconcat(dir->storage_name, "/", fname, NULL);
        }
 }
 
@@ -403,6 +404,11 @@ static void fs_list_get_roots(struct fs_list_iterate_context *ctx)
                           we just want to see its contents (not the
                           INBOX's children). */
                        root = "";
+               } else if (*prefix_vname == '\0') {
+                       /* we need to handle "" explicitly here, because getting
+                          storage name with mail_shared_explicit_inbox=no
+                          would return root=INBOX. */
+                       root = "";
                } else {
                        root = mailbox_list_get_storage_name(ctx->ctx.list,
                                                             prefix_vname);