[dovecot-cvs] dovecot/src/lib-index/maildir maildir-index.c,1.11,1.12

cras at procontrol.fi cras at procontrol.fi
Thu Oct 24 01:07:39 EEST 2002


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

Modified Files:
	maildir-index.c 
Log Message:
Ignore and leave maildir flags after ',' character (eg. file:2,S,U123).



Index: maildir-index.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-index/maildir/maildir-index.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- maildir-index.c	20 Oct 2002 01:12:27 -0000	1.11
+++ maildir-index.c	23 Oct 2002 21:07:37 -0000	1.12
@@ -19,7 +19,7 @@
 		return default_flags;
 
 	flags = 0;
-	for (info += 3; *info != '\0'; info++) {
+	for (info += 3; *info != '\0' && *info != ','; info++) {
 		switch (*info) {
 		case 'R': /* replied */
 			flags |= MAIL_ANSWERED;
@@ -83,7 +83,7 @@
 		       (*oldflags >= 'a' && *oldflags <= 'z'))
 			oldflags++;
 
-		nextflag = *oldflags == '\0' ? 256 :
+		nextflag = *oldflags == '\0' || *oldflags == ',' ? 256 :
 			(unsigned char) *oldflags;
 
 		if ((flags & MAIL_DRAFT) && nextflag > 'D') {
@@ -115,10 +115,16 @@
 			flags &= ~MAIL_CUSTOM_FLAGS_MASK;
 		}
 
-		if (*oldflags == '\0')
+		if (*oldflags == '\0' || *oldflags == ',')
 			break;
 
 		*p++ = *oldflags++;
+	}
+
+	if (*oldflags == ',') {
+		/* another flagset, we don't know about these, just keep them */
+		while (*oldflags != '\0')
+			*p++ = *oldflags++;
 	}
 
 	*p = '\0';




More information about the dovecot-cvs mailing list