]> diplodocus.org Git - nmh/blobdiff - uip/mhparam.c
SPECS: Use `command-line interface' in one-line summary.
[nmh] / uip / mhparam.c
index d726d53e99130e6465c9ea85fa4c811576278a08..e8047be68abd2f1a11d9856ee16941fbd8457c7f 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <h/mh.h>
 #include <h/mts.h>
+#include "h/done.h"
 #include <h/utils.h>
 
 #define MHPARAM_SWITCHES \
@@ -131,13 +132,14 @@ static struct proc procs [] = {
 /*
  * static prototypes
  */
-static char *p_find(char *);
+static char *p_find(char *) PURE;
 
 
 int
 main(int argc, char **argv)
 {
-    int i, compp = 0, missed = 0;
+    int i, compp = 0;
+    bool missed;
     int all = 0, debug = 0;
     int components = -1;
     char *cp, buf[BUFSIZ], **argp;
@@ -232,6 +234,7 @@ main(int argc, char **argv)
 
     }
 
+    missed = false;
     if (! all) {
         if (components < 0)
            components = compp > 1;
@@ -252,13 +255,12 @@ main(int argc, char **argv)
                    printf("%s: ", comps[i]);
 
                puts(value);
-           } else if (missed < MAX_EXIT)
-               missed++;
+           } else
+                missed = true;
        }
     }
 
-    done (missed);
-    return 1;
+    done(missed);
 }
 
 
@@ -269,7 +271,7 @@ p_find(char *str)
 
     for (ps = procs; ps->p_name; ps++)
        if (!strcasecmp (ps->p_name, str))
-           return (*ps->p_field);
+           return *ps->p_field;
 
     return NULL;
 }