]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Empty mailbox name isn't valid.
authorTimo Sirainen <tss@iki.fi>
Fri, 31 May 2013 23:56:25 +0000 (02:56 +0300)
committerTimo Sirainen <tss@iki.fi>
Fri, 31 May 2013 23:56:25 +0000 (02:56 +0300)
src/lib-storage/mailbox-list.c

index 5eedf047d013b3471c718b4567f7efdb97971160..cdf3201c98c0e0af9da50961551cf6670bf3d60b 100644 (file)
@@ -1188,10 +1188,14 @@ mailbox_list_is_valid_fs_name(struct mailbox_list *list, const char *name,
 bool mailbox_list_is_valid_name(struct mailbox_list *list,
                                const char *name, const char **error_r)
 {
-       if (*name == '\0' && *list->ns->prefix != '\0') {
-               /* an ugly way to get to mailbox root (e.g. Maildir/ when
-                  it's not the INBOX) */
-               return TRUE;
+       if (*name == '\0') {
+               if (*list->ns->prefix != '\0') {
+                       /* an ugly way to get to mailbox root (e.g. Maildir/
+                          when it's not the INBOX) */
+                       return TRUE;
+               }
+               *error_r = "Name is empty";
+               return FALSE;
        }
 
        return mailbox_list_is_valid_fs_name(list, name, error_r);