]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: STATUS (X-GUID) added extra space to result.
authorTimo Sirainen <tss@iki.fi>
Wed, 9 Jun 2010 18:22:23 +0000 (19:22 +0100)
committerTimo Sirainen <tss@iki.fi>
Wed, 9 Jun 2010 18:22:23 +0000 (19:22 +0100)
--HG--
branch : HEAD

src/imap/imap-status.c

index 2325b49e8eb95377ae82b218e28b334a75f1abcf..df6cb5429424427f28202c1281423b5f553f3d57 100644 (file)
@@ -107,12 +107,14 @@ void imap_status_send(struct client *client, const char *mailbox,
 {
        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 @@ void imap_status_send(struct client *client, const char *mailbox,
                            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, ')');