[dovecot-cvs] dovecot/src/lib-storage/index/maildir maildir-storage.c,1.55,1.56

cras at procontrol.fi cras at procontrol.fi
Mon Sep 15 21:49:06 EEST 2003


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

Modified Files:
	maildir-storage.c 
Log Message:
Ignore hierarchy separator at the end of mailbox name.



Index: maildir-storage.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/maildir/maildir-storage.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- maildir-storage.c	15 Sep 2003 17:38:37 -0000	1.55
+++ maildir-storage.c	15 Sep 2003 17:49:04 -0000	1.56
@@ -126,8 +126,7 @@
 	size_t len;
 
 	len = strlen(name);
-	if (len == 0 ||
-	    name[0] == MAILDIR_FS_SEP || name[len-1] == MAILDIR_FS_SEP ||
+	if (len == 0 || name[0] == MAILDIR_FS_SEP ||
 	    strchr(name, '*') != NULL || strchr(name, '%') != NULL)
 		return FALSE;
 
@@ -173,6 +172,12 @@
 {
 	char *dup, *p, sep;
 	size_t len;
+
+	len = strlen(name);
+	if (len > 1 && name[len-1] == storage->hierarchy_sep) {
+		/* mailbox and mailbox/ should be treated equally */
+		name = t_strndup(name, len-1);
+	}
 
 	if (strncasecmp(name, "INBOX", 5) == 0 &&
 	    (name[5] == '\0' || name[5] == storage->hierarchy_sep)) {



More information about the dovecot-cvs mailing list