changeset 11513:425f635ebaa9 HEAD

imap: STATUS (X-GUID) added extra space to result.
author Timo Sirainen <tss@iki.fi>
date Wed, 09 Jun 2010 19:22:23 +0100
parents 3dfe1690b568
children 9c4b07e13cd2
files src/imap/imap-status.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/imap/imap-status.c	Wed Jun 09 18:53:40 2010 +0100
+++ b/src/imap/imap-status.c	Wed Jun 09 19:22:23 2010 +0100
@@ -107,12 +107,14 @@
 {
 	const struct mailbox_status *status = &result->status;
 	string_t *str;
+	unsigned int prefix_len;
 
 	str = t_str_new(128);
 	str_append(str, "* STATUS ");
         imap_quote_append_string(str, mailbox, FALSE);
 	str_append(str, " (");
 
+	prefix_len = str_len(str);
 	if ((items->mailbox_items & STATUS_MESSAGES) != 0)
 		str_printfa(str, "MESSAGES %u ", status->messages);
 	if ((items->mailbox_items & STATUS_RECENT) != 0)
@@ -136,7 +138,7 @@
 			    mail_guid_128_to_string(result->mailbox_guid));
 	}
 
-	if (items != 0)
+	if (str_len(str) != prefix_len)
 		str_truncate(str, str_len(str)-1);
 	str_append_c(str, ')');