Ignore folders with an empty sequence in new
authorc_14 <git@c-14.de>
Mon, 1 Oct 2018 14:01:52 +0000 (16:01 +0200)
committermarkus schnalke <meillo@marmaro.de>
Wed, 31 Oct 2018 10:29:20 +0000 (11:29 +0100)
This solves the issue where `new' lists folders that have an empty
sequence (e.g. the unseen sequence), this also prevents `fnext' and
`fprev' from navigating to such folders.

uip/new.c

index 9763376..21435b3 100644 (file)
--- a/uip/new.c
+++ b/uip/new.c
@@ -121,7 +121,10 @@ get_msgnums(char *folder, char *sequences[])
                        */
                        if (seq_in_list(f.name, sequences)) {
                                this_msgnums = trimcpy(f.value);
-                               if (msgnums == NULL) {
+                               if (strlen(this_msgnums) == 0) {
+                                       free(this_msgnums);
+                                       continue;
+                               } else if (msgnums == NULL) {
                                        msgnums = this_msgnums;
                                } else {
                                        old_msgnums = msgnums;