deleted DELETE
David Carter
dpc22 at cam.ac.uk
Thu Aug 30 05:26:50 EDT 2007
On Wed, 29 Aug 2007, David Carter wrote:
> mboxname_isusermailbox() works on internal mailbox names. I don't think that
> it needs to worry about IMAPOPT_UNIXHIERARCHYSEP.
Here's a trivial patch to remove the IMAPOPT_UNIXHIERARCHYSEP stuff.
Otherwise mboxname_isusermailbox() is broken when unixhierarchysep is set.
--
David Carter Email: David.Carter at ucs.cam.ac.uk
University Computing Service, Phone: (01223) 334502
New Museums Site, Pembroke Street, Fax: (01223) 334679
Cambridge UK. CB2 3QH.
Index: imap/mboxname.c
===================================================================
RCS file: /cvs/src/cyrus/imap/mboxname.c,v
retrieving revision 1.38
diff -u -d -r1.38 mboxname.c
--- imap/mboxname.c 28 Aug 2007 18:42:28 -0000 1.38
+++ imap/mboxname.c 30 Aug 2007 09:25:27 -0000
@@ -601,7 +601,6 @@
const char *p;
const char *start = name;
const char *deletedprefix = config_getstring(IMAPOPT_DELETEDPREFIX);
- const char sep = config_getswitch(IMAPOPT_UNIXHIERARCHYSEP) ? '/' : '.';
int len = strlen(deletedprefix);
int isdel = 0;
@@ -610,13 +609,13 @@
start = p + 1;
/* step past any deleted bit */
- if (mboxlist_delayed_delete_isenabled() && strlen(start) > len && !strncmp(start, deletedprefix, len) && start[len] == sep) {
+ if (mboxlist_delayed_delete_isenabled() && strlen(start) > len && !strncmp(start, deletedprefix, len) && start[len] == '.') {
start += len + 1;
- isdel = 1; /* there's an additional sep + hextimestamp on isdel folders */
+ isdel = 1; /* there's an additional '.' + hextimestamp on isdel folders */
}
- if (strlen(start) > 5 && !strncmp(start, "user", 4) && start[4] == sep &&
- (!isinbox || !strchr(start+5, sep)) || (isdel && (p = strchr(start+5, sep)) && !strchr(p+1, sep)))
+ if (strlen(start) > 5 && !strncmp(start, "user", 4) && start[4] == '.' &&
+ (!isinbox || !strchr(start+5, '.')) || (isdel && (p = strchr(start+5, '.')) && !strchr(p+1, '.')))
return (char*) start+5;
else
return NULL;
More information about the Cyrus-devel
mailing list