changeset 491:a18cfbfbdad4 HEAD

Ignore and leave maildir flags after ',' character (eg. file:2,S,U123).
author Timo Sirainen <tss@iki.fi>
date Thu, 24 Oct 2002 00:07:37 +0300
parents fd0181ae25f6
children efa46e28a0d7
files src/lib-index/maildir/maildir-index.c
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/maildir/maildir-index.c	Wed Oct 23 23:41:35 2002 +0300
+++ b/src/lib-index/maildir/maildir-index.c	Thu Oct 24 00:07:37 2002 +0300
@@ -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,12 +115,18 @@
 			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';
 
 	return t_strconcat(fname, ":2,", flags_buf, NULL);