]> diplodocus.org Git - nmh/blobdiff - uip/pick.c
runpty.c: Move child slave code into new run_command().
[nmh] / uip / pick.c
index 801716fe3cb35934724360608ee6dfad36268d4a..d252f3cc7086ec602d2e8a3bd545c43611912d00 100644 (file)
@@ -1,6 +1,4 @@
-
-/*
- * pick.c -- search for messages by content
+/* pick.c -- search for messages by content
  *
  * This code is Copyright (c) 2002, 2008, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
@@ -10,7 +8,9 @@
 #include <h/mh.h>
 #include <h/tws.h>
 #include <h/picksbr.h>
+#include "h/done.h"
 #include <h/utils.h>
+#include "sbr/m_maildir.h"
 
 #define PICK_SWITCHES \
     X("reverse", 0, REVSW) \
@@ -73,11 +73,7 @@ main (int argc, char **argv)
 
     if (nmh_init(argv[0], 1)) { return 1; }
 
-    done=putzero_done;
-
-    /* Deprecated.  Use -debug instead. */
-    if ((cp = getenv ("MHPDEBUG")) && *cp)
-       ++debug;
+    set_done(putzero_done);
 
     arguments = getarguments (invo_name, argc, argv, 1);
     argp = arguments;
@@ -178,8 +174,7 @@ main (int argc, char **argv)
        if (*cp == '+' || *cp == '@') {
            if (folder)
                adios (NULL, "only one folder at a time!");
-           else
-               folder = pluspath (cp);
+            folder = pluspath (cp);
        } else
                app_msgarg(&msgs, cp);
     }
@@ -306,7 +301,7 @@ main (int argc, char **argv)
      * Print total matched if not printing each matched message number.
      */
     if (!listsw) {
-       printf ("%d hit%s\n", mp2->numsel, mp2->numsel == 1 ? "" : "s");
+       printf ("%d hit%s\n", mp2->numsel, PLURALS(mp2->numsel));
     }
 
     svector_free (seqs);
@@ -320,7 +315,7 @@ main (int argc, char **argv)
 }
 
 
-static void
+static void NORETURN
 putzero_done (int status)
 {
     if (listsw && status && !isatty (fileno (stdout)))