X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/8a14191c0a0ad15bb8f35b49748c75c1e0a8c2f4..0a01282c77d958d15a135ade3fcd1ef6c57c7273:/uip/mhparam.c?ds=inline diff --git a/uip/mhparam.c b/uip/mhparam.c index fb457848..e8047be6 100644 --- a/uip/mhparam.c +++ b/uip/mhparam.c @@ -1,6 +1,4 @@ - -/* - * mhparam.c -- print mh_profile values +/* mhparam.c -- print mh_profile values * * Originally contributed by * Jeffrey C Honig @@ -12,6 +10,8 @@ #include #include +#include "h/done.h" +#include #define MHPARAM_SWITCHES \ X("components", 0, COMPSW) \ @@ -115,7 +115,6 @@ static struct proc procs [] = { { "whomproc", &whomproc }, { "bindir", &mhbindir }, { "libexecdir", &mhlibexecdir }, - { "libdir", &mhlibexecdir }, { "etcdir", &mhetcdir }, { "docdir", &mhdocdir }, { "localmbox", &localmbox }, @@ -133,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; @@ -230,10 +230,11 @@ main(int argc, char **argv) * value (as determined after context is read). */ for (ps = procs; ps->p_name; ps++) - printf ("%s: %s\n", ps->p_name, *ps->p_field ? *ps->p_field : ""); + printf ("%s: %s\n", ps->p_name, FENDNULL(*ps->p_field)); } + missed = false; if (! all) { if (components < 0) components = compp > 1; @@ -254,13 +255,12 @@ main(int argc, char **argv) printf("%s: ", comps[i]); puts(value); - } else if (missed < 120) - missed++; + } else + missed = true; } } - done (missed); - return 1; + done(missed); } @@ -271,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; }