]> granicus.if.org Git - neomutt/commitdiff
maildir: tidy maildir_check_dir() 1407/head
authorRichard Russon <rich@flatcap.org>
Fri, 7 Dec 2018 00:43:38 +0000 (00:43 +0000)
committerRichard Russon <rich@flatcap.org>
Fri, 7 Dec 2018 00:44:07 +0000 (00:44 +0000)
maildir/maildir.c
maildir/maildir_private.h

index 204b16da2c42174b14bed97885f2d1bee10d2da7..93cd615f4d08f13248dd5595ad5dc357af13e8e8 100644 (file)
  * @param dir_name    Path to Mailbox
  * @param check_new   if true, check for new mail
  * @param check_stats if true, count total, new, and flagged messages
- * @retval 1 if the dir has new mail
  *
  * Checks the specified maildir subdir (cur or new) for new mail or mail counts.
  */
-int maildir_check_dir(struct Mailbox *m, const char *dir_name, bool check_new, bool check_stats)
+static void maildir_check_dir(struct Mailbox *m, const char *dir_name, bool check_new, bool check_stats)
 {
   DIR *dirp = NULL;
   struct dirent *de = NULL;
   char *p = NULL;
-  int rc = 0;
   struct stat sb;
 
   struct Buffer *path = mutt_buffer_pool_get();
@@ -85,7 +83,6 @@ int maildir_check_dir(struct Mailbox *m, const char *dir_name, bool check_new, b
     if (stat(mutt_b2s(path), &sb) == 0 &&
         mutt_file_stat_timespec_compare(&sb, MUTT_STAT_MTIME, &m->last_visited) < 0)
     {
-      rc = 0;
       check_new = false;
     }
   }
@@ -97,7 +94,6 @@ int maildir_check_dir(struct Mailbox *m, const char *dir_name, bool check_new, b
   if (!dirp)
   {
     m->magic = MUTT_UNKNOWN;
-    rc = 0;
     goto cleanup;
   }
 
@@ -133,7 +129,6 @@ int maildir_check_dir(struct Mailbox *m, const char *dir_name, bool check_new, b
           }
         }
         m->has_new = true;
-        rc = 1;
         check_new = false;
         if (!check_stats)
           break;
@@ -146,8 +141,6 @@ int maildir_check_dir(struct Mailbox *m, const char *dir_name, bool check_new, b
 cleanup:
   mutt_buffer_pool_release(&path);
   mutt_buffer_pool_release(&msgpath);
-
-  return rc;
 }
 
 /**
index 3b0c9c29b63966d16998ff80ee6804a1daa4e0ae..8d62b3a80b223d0ff9738945d0cd2542f8add18e 100644 (file)
@@ -92,7 +92,6 @@ int             mh_msg_close       (struct Mailbox *m, struct Message *msg);
 
 /* Maildir/MH shared functions */
 void                    maildir_canon_filename (struct Buffer *dest, const char *src);
-int                     maildir_check_dir      (struct Mailbox *m, const char *dir_name, bool check_new, bool check_stats);
 void                    maildir_delayed_parsing(struct Mailbox *m, struct Maildir **md, struct Progress *progress);
 struct MaildirMboxData *maildir_mdata_get      (struct Mailbox *m);
 int                     maildir_mh_open_message(struct Mailbox *m, struct Message *msg, int msgno, bool is_maildir);