From: Larry Rosenman Date: Sun, 22 Oct 2017 02:24:31 +0000 (-0500) Subject: Issue 888: Fix imap mailbox flag logging X-Git-Tag: neomutt-20171027~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d5fa16386a61beadf5de7fd06c57dd1548177f98;p=neomutt Issue 888: Fix imap mailbox flag logging remove the blank line in the keywords logging, per @flatcap use Buffer and related functions for mailbox flag print Review comments from @flatcap on IRC free() -> FREE() revert free() -> FREE() Correct use of FREE() per @flatcap tabs->spaces, per @flatcap clang-format One log line for flags, per @gahr --- diff --git a/imap/imap.c b/imap/imap.c index 87abaca5b..6f5249a6d 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -175,7 +175,8 @@ int imap_delete_mailbox(struct Context *ctx, struct ImapMbox *mx) if (!ctx || !ctx->data) { - idata = imap_conn_find(&mx->account, option(OPT_IMAP_PASSIVE) ? MUTT_IMAP_CONN_NONEW : 0); + idata = imap_conn_find(&mx->account, + option(OPT_IMAP_PASSIVE) ? MUTT_IMAP_CONN_NONEW : 0); if (!idata) { FREE(&mx->mbox); @@ -790,13 +791,16 @@ static int imap_open_mailbox(struct Context *ctx) mutt_debug(3, "No folder flags found\n"); else { - mutt_debug(3, "Mailbox flags: "); struct ListNode *np; + struct Buffer flag_buffer; + mutt_buffer_init(&flag_buffer); + mutt_buffer_printf(&flag_buffer, "Mailbox flags: "); STAILQ_FOREACH(np, &idata->flags, entries) { - mutt_debug(3, "[%s] ", np->data); + mutt_buffer_printf(&flag_buffer, "[%s] ", np->data); } - mutt_debug(3, "\n"); + mutt_debug(3, "%s\n", flag_buffer.data); + FREE(&flag_buffer.data); } } #endif