[dovecot-cvs] dovecot/src/imap cmd-list.c,1.65,1.66

tss at dovecot.org tss at dovecot.org
Thu Mar 15 23:20:00 EET 2007


Update of /var/lib/cvs/dovecot/src/imap
In directory talvi:/tmp/cvs-serv28756

Modified Files:
	cmd-list.c 
Log Message:
Last change caused LIST replies to have extra spaces



Index: cmd-list.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-list.c,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -d -r1.65 -r1.66
--- cmd-list.c	15 Mar 2007 01:25:03 -0000	1.65
+++ cmd-list.c	15 Mar 2007 21:19:58 -0000	1.66
@@ -31,6 +31,8 @@
 mailbox_flags2str(string_t *str, enum mailbox_info_flags flags,
 		  enum mailbox_list_flags list_flags)
 {
+	unsigned int orig_len = str_len(str);
+
 	if ((flags & MAILBOX_NONEXISTENT) != 0 &&
 	    (list_flags & _MAILBOX_LIST_ITER_LISTEXT) == 0) {
 		flags |= MAILBOX_NOSELECT;
@@ -41,19 +43,22 @@
 		flags &= ~(MAILBOX_CHILDREN|MAILBOX_NOCHILDREN);
 
 	if ((flags & MAILBOX_NOSELECT) != 0)
-		str_append(str, " \\Noselect");
+		str_append(str, "\\Noselect ");
 	if ((flags & MAILBOX_NONEXISTENT) != 0)
-		str_append(str, " \\NonExistent");
+		str_append(str, "\\NonExistent ");
 	if ((flags & MAILBOX_CHILDREN) != 0)
-		str_append(str, " \\HasChildren");
+		str_append(str, "\\HasChildren ");
 	if ((flags & MAILBOX_NOCHILDREN) != 0)
-		str_append(str, " \\HasNoChildren");
+		str_append(str, "\\HasNoChildren ");
 	if ((flags & MAILBOX_NOINFERIORS) != 0)
-		str_append(str, " \\NoInferiors");
+		str_append(str, "\\NoInferiors ");
 	if ((flags & MAILBOX_MARKED) != 0)
-		str_append(str, " \\Marked");
+		str_append(str, "\\Marked ");
 	if ((flags & MAILBOX_UNMARKED) != 0)
-		str_append(str, " \\UnMarked");
+		str_append(str, "\\UnMarked ");
+
+	if (str_len(str) != orig_len)
+		str_truncate(str, str_len(str)-1);
 }
 
 static bool



More information about the dovecot-cvs mailing list