From: Richard Russon Date: Fri, 7 Dec 2018 00:43:38 +0000 (+0000) Subject: maildir: tidy maildir_check_dir() X-Git-Tag: 2019-10-25~460^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=refs%2Fpull%2F1407%2Fhead;p=neomutt maildir: tidy maildir_check_dir() --- diff --git a/maildir/maildir.c b/maildir/maildir.c index 204b16da2..93cd615f4 100644 --- a/maildir/maildir.c +++ b/maildir/maildir.c @@ -61,16 +61,14 @@ * @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; } /** diff --git a/maildir/maildir_private.h b/maildir/maildir_private.h index 3b0c9c29b..8d62b3a80 100644 --- a/maildir/maildir_private.h +++ b/maildir/maildir_private.h @@ -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);