]> diplodocus.org Git - nmh/blobdiff - uip/new.c
mhlsbr.c: Delete file-static function pointer mhl_action.
[nmh] / uip / new.c
index f9549331970af56339f5434eb0731b2e9ab396dd..ae5f376510fa2494f286db03f5e142dad979c36c 100644 (file)
--- a/uip/new.c
+++ b/uip/new.c
@@ -14,8 +14,8 @@
 #include <h/mh.h>
 #include <h/crawl_folders.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 +75,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,19 +114,16 @@ 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;
 
     if ((fp = lkfopendata (seqfile, "r", & failed_to_lock)) == NULL) {
-
-       if (failed_to_lock) {
+       if (failed_to_lock)
            adios (seqfile, "failed to lock");
-       } else {
-           free(seqfile);
-           return NULL;
-       }
+        free(seqfile);
+        return NULL;
     }
 
     /* Use m_getfld2 to scan sequence file */
@@ -153,7 +150,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);
                        }
@@ -168,7 +165,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);
                        }
@@ -228,11 +225,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:
@@ -373,10 +370,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;
@@ -398,7 +394,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");