]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
mailbox_list_get_unexpanded_path(): Don't crash if namespace location is already...
authorTimo Sirainen <tss@iki.fi>
Mon, 14 Jun 2010 19:39:06 +0000 (20:39 +0100)
committerTimo Sirainen <tss@iki.fi>
Mon, 14 Jun 2010 19:39:06 +0000 (20:39 +0100)
--HG--
branch : HEAD

src/lib-storage/mailbox-list.c

index becf5c7a3b4d87646a3693eb5f60c1f9e798e652..79b3ce65c5c766397feb6dde1747c79af081809c 100644 (file)
@@ -315,6 +315,11 @@ const char *mailbox_list_get_unexpanded_path(struct mailbox_list *list,
        struct mailbox_list_settings set;
        const char *p, *error;
 
+       if (*location == '1') {
+               /* set using -o or userdb lookup. */
+               return "";
+       }
+
        i_assert(*location == '0');
        location++;
 
@@ -323,10 +328,8 @@ const char *mailbox_list_get_unexpanded_path(struct mailbox_list *list,
                        user->unexpanded_set, MAIL_STORAGE_SET_DRIVER_NAME);
                i_assert(mail_set != NULL);
                location = mail_set->mail_location;
-               if (*location == '1') {
-                       /* we'll get here if using -o mail_location=.. */
+               if (*location == '1')
                        return "";
-               }
                i_assert(*location == '0');
                location++;
        }