[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-list.c, 1.36, 1.37 mbox-storage.c, 1.140, 1.141 mbox-storage.h, 1.41, 1.42

cras at dovecot.org cras at dovecot.org
Sat Apr 1 12:36:28 EEST 2006


Update of /var/lib/cvs/dovecot/src/lib-storage/index/mbox
In directory talvi:/tmp/cvs-serv5478/lib-storage/index/mbox

Modified Files:
	mbox-list.c mbox-storage.c mbox-storage.h 
Log Message:
Don't hide all .files when listing mboxes, only .imap and .subscriptions.
Moved the hardcoded ".imap" strings into a define.



Index: mbox-list.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-list.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- mbox-list.c	27 Feb 2006 16:21:59 -0000	1.36
+++ mbox-list.c	1 Apr 2006 09:36:25 -0000	1.37
@@ -223,8 +223,10 @@
 	int ret;
 	bool noselect;
 
-	/* skip all hidden files */
-	if (fname[0] == '.')
+	/* skip subscription file and .imap/ directory */
+	if (fname[0] == '.' &&
+	    (strcmp(fname, SUBSCRIPTION_FILE_NAME) == 0 ||
+	     strcmp(fname, MBOX_INDEX_DIR_NAME) == 0))
 		return 0;
 
 	/* skip all .lock files */

Index: mbox-storage.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-storage.c,v
retrieving revision 1.140
retrieving revision 1.141
diff -u -d -r1.140 -r1.141
--- mbox-storage.c	26 Feb 2006 10:05:22 -0000	1.140
+++ mbox-storage.c	1 Apr 2006 09:36:25 -0000	1.141
@@ -150,7 +150,8 @@
 	if (*path != '\0' && mbox_is_file(path, "INBOX file", debug))
 		return TRUE;
 
-	if (mbox_is_dir(t_strconcat(path, "/.imap", NULL), "has .imap/", debug))
+	if (mbox_is_dir(t_strconcat(path, "/"MBOX_INDEX_DIR_NAME, NULL),
+			"has "MBOX_INDEX_DIR_NAME"/", debug))
 		return TRUE;
 	if (mbox_is_file(t_strconcat(path, "/inbox", NULL), "has inbox", debug))
 		return TRUE;
@@ -429,16 +430,17 @@
 		name = home_expand(name);
 		p = strrchr(name, '/');
 		return t_strconcat(t_strdup_until(name, p),
-				   "/.imap/", p+1, NULL);
+				   "/"MBOX_INDEX_DIR_NAME"/", p+1, NULL);
 	}
 
 	p = strrchr(name, '/');
-	if (p == NULL)
-		return t_strconcat(storage->index_dir, "/.imap/", name, NULL);
-	else {
+	if (p == NULL) {
+		return t_strconcat(storage->index_dir,
+				   "/"MBOX_INDEX_DIR_NAME"/", name, NULL);
+	} else {
 		return t_strconcat(storage->index_dir, "/",
 				   t_strdup_until(name, p),
-				   "/.imap/", p+1, NULL);
+				   "/"MBOX_INDEX_DIR_NAME"/", p+1, NULL);
 	}
 }
 
@@ -830,7 +832,7 @@
 		/* deleting a folder, only allow it if it's empty.
 		   Delete .imap folder before to make sure it goes empty. */
 		index_dir = t_strconcat(storage->index_dir, "/", name,
-					"/.imap", NULL);
+					"/"MBOX_INDEX_DIR_NAME, NULL);
 
 		if (index_dir != NULL && rmdir(index_dir) < 0 &&
 		    !ENOTFOUND(errno) && errno != ENOTEMPTY) {

Index: mbox-storage.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-storage.h,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- mbox-storage.h	22 Feb 2006 16:02:27 -0000	1.41
+++ mbox-storage.h	1 Apr 2006 09:36:25 -0000	1.42
@@ -8,6 +8,7 @@
 
 #define SUBSCRIPTION_FILE_NAME ".subscriptions"
 #define MBOX_INDEX_PREFIX "dovecot.index"
+#define MBOX_INDEX_DIR_NAME ".imap"
 
 #include "index-storage.h"
 



More information about the dovecot-cvs mailing list