dovecot-1.1: dbox: Set MAILBOX_NOCHILDREN flag for selectable ma...

dovecot at dovecot.org dovecot at dovecot.org
Thu Jun 12 02:08:21 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/1e85ec5a95be
changeset: 7638:1e85ec5a95be
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Jun 12 02:08:16 2008 +0300
description:
dbox: Set MAILBOX_NOCHILDREN flag for selectable mailboxes if we know it.

diffstat:

1 file changed, 6 insertions(+), 3 deletions(-)
src/lib-storage/index/dbox/dbox-storage.c |    9 ++++++---

diffs (21 lines):

diff -r f6af305569df -r 1e85ec5a95be src/lib-storage/index/dbox/dbox-storage.c
--- a/src/lib-storage/index/dbox/dbox-storage.c	Thu Jun 12 02:03:17 2008 +0300
+++ b/src/lib-storage/index/dbox/dbox-storage.c	Thu Jun 12 02:08:16 2008 +0300
@@ -634,11 +634,14 @@ static int dbox_list_iter_is_mailbox(str
 	if ((*flags & (MAILBOX_NOSELECT | MAILBOX_NONEXISTENT)) == 0) {
 		/* make sure it's a selectable mailbox */
 		maildir_path = t_strconcat(path, "/"DBOX_MAILDIR_NAME, NULL);
-		if (stat(maildir_path, &st2) < 0 || !S_ISDIR(st2.st_mode)) {
+		if (stat(maildir_path, &st2) < 0 || !S_ISDIR(st2.st_mode))
 			*flags |= MAILBOX_NOSELECT;
-			if (st.st_nlink == 3 &&
-			    *ctx->list->set.maildir_name != '\0')
+		if (st.st_nlink == 3 && *ctx->list->set.maildir_name != '\0') {
+			/* now we know what link count 3 means. */
+			if ((*flags & MAILBOX_NOSELECT) != 0)
 				*flags |= MAILBOX_CHILDREN;
+			else
+				*flags |= MAILBOX_NOCHILDREN;
 		}
 	}
 	return ret;


More information about the dovecot-cvs mailing list