[dovecot-cvs] dovecot/src/lib-storage/index/maildir maildir-list.c,1.3,1.4

cras at procontrol.fi cras at procontrol.fi
Wed Dec 4 00:44:41 EET 2002


Update of /home/cvs/dovecot/src/lib-storage/index/maildir
In directory danu:/tmp/cvs-serv18428/src/lib-storage/index/maildir

Modified Files:
	maildir-list.c 
Log Message:
Rewrote imap_match() function. Maybe not as fast as before, but at least
it's understandable now. This was required to fix listing mbox mailboxes
where we wanted to match partial paths (it was pretty buggy before).



Index: maildir-list.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/maildir/maildir-list.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- maildir-list.c	31 Aug 2002 15:24:00 -0000	1.3
+++ maildir-list.c	3 Dec 2002 22:44:39 -0000	1.4
@@ -74,7 +74,7 @@
 int maildir_find_mailboxes(MailStorage *storage, const char *mask,
 			   MailboxFunc func, void *context)
 {
-        const ImapMatchGlob *glob;
+        ImapMatchGlob *glob;
 	DIR *dirp;
 	struct dirent *d;
 	struct stat st;
@@ -106,7 +106,7 @@
 
 		/* make sure the mask matches - dirs beginning with ".."
 		   should be deleted and we always want to check those. */
-		if (fname[1] == '.' || imap_match(glob, fname+1, 0, NULL) < 0)
+		if (fname[1] == '.' || imap_match(glob, fname+1) <= 0)
 			continue;
 
 		/* make sure it's a directory */
@@ -142,8 +142,7 @@
 		func(storage, fname+1, flags, context);
 	}
 
-	if (!failed && !found_inbox &&
-	    imap_match(glob, "INBOX", 0, NULL) >= 0) {
+	if (!failed && !found_inbox && imap_match(glob, "INBOX") > 0) {
 		/* .INBOX directory doesn't exist yet, but INBOX still exists */
 		func(storage, "INBOX", 0, context);
 	}




More information about the dovecot-cvs mailing list