]> diplodocus.org Git - nmh/blobdiff - uip/new.c
expect this commit to be force-replaced periodically
[nmh] / uip / new.c
index b09e1aaca96acb96f145fdc7644605a5d353ec3d..0dee3c37fa13a4d65b6513c79004629dda6d668c 100644 (file)
--- a/uip/new.c
+++ b/uip/new.c
 
 #include <sys/types.h>
 
-#include <h/mh.h>
+#include "h/mh.h"
+#include "sbr/m_getfld.h"
+#include "sbr/getarguments.h"
+#include "sbr/concat.h"
+#include "sbr/smatch.h"
+#include "sbr/r1bindex.h"
+#include "sbr/trimcpy.h"
+#include "sbr/vfgets.h"
+#include "sbr/getcpy.h"
+#include "sbr/m_atoi.h"
+#include "sbr/context_save.h"
+#include "sbr/context_replace.h"
+#include "sbr/context_find.h"
+#include "sbr/brkstring.h"
+#include "sbr/ambigsw.h"
+#include "sbr/print_version.h"
+#include "sbr/print_help.h"
 #include "sbr/error.h"
-#include <h/crawl_folders.h>
+#include "sbr/crawl_folders.h"
 #include "h/done.h"
-#include <h/utils.h>
+#include "h/utils.h"
 #include "sbr/lock_file.h"
 #include "sbr/m_maildir.h"
 
@@ -57,13 +73,13 @@ count_messages(char *field)
 {
     int total = 0;
     int j, k;
-    char *cp, **ap;
 
     field = getcpy(field);
 
     /* copied from seq_read.c:seq_init */
-    for (ap = brkstring (field, " ", "\n"); *ap; ap++) {
-        if ((cp = strchr(*ap, '-')))
+    for (char *const *ap = brkstring (field, " ", "\n"); *ap; ap++) {
+        char *cp = strchr(*ap, '-');
+        if (cp != NULL)
             *cp++ = '\0';
         if ((j = m_atoi (*ap)) > 0) {
             k = cp ? m_atoi (cp) : j;
@@ -119,7 +135,7 @@ get_msgnums(char *folder, char *sequences[])
     seqfile = concat(m_maildir(folder), "/", mh_seq, NULL);
 
     if (seqfile == NULL)
-       return NULL;
+       return NULL;
 
     if ((fp = lkfopendata (seqfile, "r", & failed_to_lock)) == NULL) {
        if (failed_to_lock)
@@ -437,7 +453,7 @@ doit(char *cur, char *folders, char *sequences[])
 int
 main(int argc, char **argv)
 {
-    char **ap, *cp, **argp, **arguments;
+    char *cp, **argp, **arguments;
     char help[BUFSIZ];
     char *folders = NULL;
     svector_t sequences = svector_create (0);
@@ -511,7 +527,7 @@ main(int argc, char **argv)
        if (unseen == NULL || unseen[0] == '\0') {
            die("must specify sequences or set %s", usequence);
        }
-       for (ap = brkstring(unseen, " ", "\n"); *ap; ap++) {
+       for (char *const *ap = brkstring(unseen, " ", "\n"); *ap; ap++) {
            svector_push_back (sequences, *ap);
            ++i;
        }