From d5fa16386a61beadf5de7fd06c57dd1548177f98 Mon Sep 17 00:00:00 2001 From: Larry Rosenman Date: Sat, 21 Oct 2017 21:24:31 -0500 Subject: [PATCH] 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 --- imap/imap.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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 -- 2.40.0