X-Git-Url: https://git.llucax.com/software/mutt-debian.git/blobdiff_plain/19304f7c526fbe36ba0db2fb80bcaf3bd974d81d..460f7ef5018d2c01af1e13ef02bd3e77e29b8364:/browser.c diff --git a/browser.c b/browser.c index e9c6390..c05af05 100644 --- a/browser.c +++ b/browser.c @@ -46,7 +46,7 @@ static struct mapping_t FolderHelp[] = { { N_("Chdir"), OP_CHANGE_DIRECTORY }, { N_("Mask"), OP_ENTER_MASK }, { N_("Help"), OP_HELP }, - { NULL } + { NULL, 0 } }; typedef struct folder_t @@ -460,6 +460,21 @@ static int examine_mailboxes (MUTTMENU *menu, struct browser_state *state) if ((! S_ISREG (s.st_mode)) && (! S_ISDIR (s.st_mode)) && (! S_ISLNK (s.st_mode))) continue; + + if (mx_is_maildir (tmp->path)) + { + struct stat st2; + char md[_POSIX_PATH_MAX]; + + snprintf (md, sizeof (md), "%s/new", tmp->path); + if (stat (md, &s) < 0) + s.st_mtime = 0; + snprintf (md, sizeof (md), "%s/cur", tmp->path); + if (stat (md, &st2) < 0) + st2.st_mtime = 0; + if (st2.st_mtime > s.st_mtime) + s.st_mtime = st2.st_mtime; + } strfcpy (buffer, NONULL(tmp->path), sizeof (buffer)); mutt_pretty_mailbox (buffer, sizeof (buffer));