Commit c48ce2b1 c48ce2b12ea3e0048a0628b611e5b0993370dc9f by Sergey Poznyakoff

(main): Display "no messages in ..." warning for empty folders.

1 parent de88b2bb
Showing 1 changed file with 12 additions and 3 deletions
......@@ -171,7 +171,8 @@ main (int argc, char **argv)
int index;
mailbox_t mbox;
int status;
size_t total = 0;
/* Native Language Support */
mu_init_nls ();
......@@ -194,7 +195,6 @@ main (int argc, char **argv)
/* Fast approach */
observer_t observer;
observable_t observable;
size_t total;
print_header (mbox);
......@@ -207,8 +207,9 @@ main (int argc, char **argv)
}
else
{
mailbox_messages_count (mbox, &total);
mh_msgset_parse (mbox, &msgset, argc, argv, "all");
if (reverse)
mh_msgset_reverse (&msgset);
......@@ -216,6 +217,14 @@ main (int argc, char **argv)
status = mh_iterate (mbox, &msgset, list_message, NULL);
}
if (total == 0)
{
url_t url = NULL;
mailbox_get_url (mbox, &url);
mh_error (_("no messages in %s"), url_to_string (url));
}
clear_screen ();
mh_global_save_state ();
......