]> granicus.if.org Git - neomutt/commitdiff
tidy mbox_close
authorRichard Russon <rich@flatcap.org>
Mon, 31 Dec 2018 02:05:20 +0000 (02:05 +0000)
committerRichard Russon <rich@flatcap.org>
Sat, 5 Jan 2019 14:44:35 +0000 (14:44 +0000)
mx.c

diff --git a/mx.c b/mx.c
index f5aa49de964be33a31dd83dc6d8bcf8f91cd02bf..093405a1dfeacd9fd9e9981c149dbe410969c54a 100644 (file)
--- a/mx.c
+++ b/mx.c
@@ -615,13 +615,13 @@ int mx_mbox_close(struct Context **pctx, int *index_hint)
     read_msgs = 0;
 #endif
 
-  if (read_msgs && Move != MUTT_NO)
+  if ((read_msgs != 0) && (Move != MUTT_NO))
   {
-    int is_spool;
+    bool is_spool;
     char *p = mutt_find_hook(MUTT_MBOX_HOOK, m->path);
     if (p)
     {
-      is_spool = 1;
+      is_spool = true;
       mutt_str_strfcpy(mbox, p, sizeof(mbox));
     }
     else
@@ -630,7 +630,7 @@ int mx_mbox_close(struct Context **pctx, int *index_hint)
       is_spool = mutt_is_spool(m->path) && !mutt_is_spool(mbox);
     }
 
-    if (is_spool && *mbox)
+    if (is_spool && (mbox[0] != '\0'))
     {
       mutt_expand_path(mbox, sizeof(mbox));
       snprintf(buf, sizeof(buf),
@@ -755,7 +755,7 @@ int mx_mbox_close(struct Context **pctx, int *index_hint)
   else
 #endif
   {
-    if (!purge)
+    if (purge == MUTT_NO)
     {
       for (i = 0; i < m->msg_count; i++)
       {
@@ -765,7 +765,7 @@ int mx_mbox_close(struct Context **pctx, int *index_hint)
       m->msg_deleted = 0;
     }
 
-    if (m->changed || m->msg_deleted)
+    if (m->changed || (m->msg_deleted != 0))
     {
       int check = sync_mailbox(ctx, index_hint);
       if (check != 0)
@@ -791,7 +791,7 @@ int mx_mbox_close(struct Context **pctx, int *index_hint)
   }
 
 #ifdef USE_SIDEBAR
-  if (purge && m->msg_deleted)
+  if ((purge == MUTT_YES) && (m->msg_deleted != 0))
   {
     for (i = 0; i < m->msg_count; i++)
     {