X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/9e4dbc2d5379b96a8d90e28cf8fce803d6cc1ff4..d247f1cf67f3e579ccddfa986c603dd91880cbe7:/uip/mhlsbr.c?ds=sidebyside diff --git a/uip/mhlsbr.c b/uip/mhlsbr.c index 5140b88e..5ff3f4dc 100644 --- a/uip/mhlsbr.c +++ b/uip/mhlsbr.c @@ -11,9 +11,10 @@ #include #include #include -#include "../sbr/m_popen.h" +#include "sbr/m_popen.h" #include #include +#include "sbr/terminal.h" /* * MAJOR BUG: @@ -315,7 +316,7 @@ static int ptos (char *, char **); static char *parse (void); static void process (char *, char *, int, int); static void mhlfile (FILE *, char *, int, int); -static int mcomp_flags (char *); +static int mcomp_flags (char *) PURE; static char *mcomp_add (unsigned long, char *, char *); static void mcomp_format (struct mcomp *, struct mcomp *); static struct mcomp *add_queue (struct mcomp **, struct mcomp **, char *, char *, int); @@ -327,8 +328,8 @@ static void putch (char, unsigned long); static void intrser (int); static void pipeser (int); static void quitser (int); -static void mhladios (char *, char *, ...) CHECK_PRINTF(2, 3); -static void mhldone (int); +static void mhladios (char *, char *, ...) CHECK_PRINTF(2, 3) NORETURN; +static void mhldone (int) NORETURN; static void filterbody (struct mcomp *, char *, int, int, m_getfld_state_t); static void compile_formatfield(struct mcomp *); @@ -360,20 +361,16 @@ mhl (int argc, char **argv) case AMBIGSW: ambigsw (cp, mhlswitches); mhldone (1); - /* FALLTHRU */ case UNKWNSW: mhladios (NULL, "-%s unknown\n", cp); - /* FALLTHRU */ case HELPSW: snprintf (buf, sizeof(buf), "%s [switches] [files ...]", invo_name); print_help (buf, mhlswitches, 1); mhldone (0); - /* FALLTHRU */ case VERSIONSW: print_version(invo_name); mhldone (0); - /* FALLTHRU */ case BELLSW: bellflg = 1; @@ -401,8 +398,7 @@ mhl (int argc, char **argv) case SLEEPSW: if (!(cp = *argp++) || *cp == '-') mhladios (NULL, "missing argument to %s", argp[-2]); - else - sleepsw = atoi (cp);/* ZERO ok! */ + sleepsw = atoi (cp);/* ZERO ok! */ continue; case PROGSW: @@ -424,13 +420,13 @@ mhl (int argc, char **argv) case LENSW: if (!(cp = *argp++) || *cp == '-') mhladios (NULL, "missing argument to %s", argp[-2]); - else if ((length = atoi (cp)) < 1) + if ((length = atoi (cp)) < 1) mhladios (NULL, "bad argument %s %s", argp[-2], cp); continue; case WIDTHSW: if (!(cp = *argp++) || *cp == '-') mhladios (NULL, "missing argument to %s", argp[-2]); - else if ((width = atoi (cp)) < 1) + if ((width = atoi (cp)) < 1) mhladios (NULL, "bad argument %s %s", argp[-2], cp); continue; @@ -441,13 +437,13 @@ mhl (int argc, char **argv) case ISSUESW: if (!(cp = *argp++) || *cp == '-') mhladios (NULL, "missing argument to %s", argp[-2]); - else if ((issue = atoi (cp)) < 1) + if ((issue = atoi (cp)) < 1) mhladios (NULL, "bad argument %s %s", argp[-2], cp); continue; case VOLUMSW: if (!(cp = *argp++) || *cp == '-') mhladios (NULL, "missing argument to %s", argp[-2]); - else if ((volume = atoi (cp)) < 1) + if ((volume = atoi (cp)) < 1) mhladios (NULL, "bad argument %s %s", argp[-2], cp); continue; @@ -1651,8 +1647,7 @@ mhldone (int status) exitstat = status; if (mhl_action) longjmp (mhlenv, DONE); - else - done (exitstat); + done (exitstat); }