]> diplodocus.org Git - nmh/blobdiff - uip/new.c
Added tests of MMDF mailbox format to test-eom-align.
[nmh] / uip / new.c
index 080f065f1c19753fa589232bb3392a0e6fd0bc14..d608883d254b28680186403a6f953203b900cda7 100644 (file)
--- a/uip/new.c
+++ b/uip/new.c
 
 #include <h/mh.h>
 #include <h/crawl_folders.h>
+#include "h/done.h"
 #include <h/utils.h>
-#include "../sbr/lock_file.h"
-#include "../sbr/m_maildir.h"
+#include "sbr/lock_file.h"
+#include "sbr/m_maildir.h"
 
 #define NEW_SWITCHES \
     X("mode", 1, MODESW) \
@@ -75,19 +76,19 @@ count_messages(char *field)
     return total;
 }
 
-/* Return TRUE if the sequence 'name' is in 'sequences'. */
-static boolean
+/* Return true if the sequence 'name' is in 'sequences'. */
+static bool
 seq_in_list(char *name, char *sequences[])
 {
     int i;
 
     for (i = 0; sequences[i] != NULL; i++) {
        if (strcmp(name, sequences[i]) == 0) {
-           return TRUE;
+           return true;
        }
     }
 
-    return FALSE;
+    return false;
 }
 
 /* Return the string list of message numbers from the sequences file, or NULL
@@ -114,7 +115,7 @@ get_msgnums(char *folder, char *sequences[])
        return NULL;
 
     /* get filename of sequence file */
-    seqfile = concat(m_maildir(folder), "/", mh_seq, (void *)NULL);
+    seqfile = concat(m_maildir(folder), "/", mh_seq, NULL);
 
     if (seqfile == NULL)
        return NULL;
@@ -150,7 +151,7 @@ get_msgnums(char *folder, char *sequences[])
                        } else {
                            old_msgnums = msgnums;
                            msgnums = concat(old_msgnums, " ",
-                                            this_msgnums, (void *)NULL);
+                                            this_msgnums, NULL);
                            free(old_msgnums);
                            free(this_msgnums);
                        }
@@ -165,7 +166,7 @@ get_msgnums(char *folder, char *sequences[])
                        } else {
                            old_msgnums = msgnums;
                            msgnums = concat(old_msgnums, " ",
-                                            this_msgnums, (void *)NULL);
+                                            this_msgnums, NULL);
                            free(old_msgnums);
                            free(this_msgnums);
                        }
@@ -225,11 +226,11 @@ check_folder(char *folder, size_t len, struct list_state *b)
     }
 }
 
-static boolean
+static bool
 crawl_callback(char *folder, void *baton)
 {
     check_folder(folder, strlen(folder), baton);
-    return TRUE;
+    return true;
 }
 
 /* Scan folders, returning:
@@ -370,10 +371,9 @@ doit(char *cur, char *folders, char *sequences[])
                 /* Found current folder in fprev mode; if we have a
                  * previous node in the list, return it; else return
                  * the last node. */
-                if (prev == NULL) {
-                    return last;
-                }
-                return prev;
+                if (prev)
+                    return prev;
+                return last;
             }
         } else if (run_mode == RM_UNSEEN) {
             int status;
@@ -395,7 +395,7 @@ doit(char *cur, char *folders, char *sequences[])
 
            /* TODO: Split enough of scan.c out so that we can call it here. */
            command = concat("scan +", node->n_name, " ", sequences_s,
-                            (void *)NULL);
+                            NULL);
            status = system(command);
            if (! WIFEXITED (status)) {
                adios (command, "system");