]> diplodocus.org Git - nmh/blobdiff - uip/mhlsbr.c
find_cache(): Remove test that's always false.
[nmh] / uip / mhlsbr.c
index 5140b88eefb689a3d97e49614b38ef8ce18bafde..5ff3f4dc926cd53460d4d76a0580333557d139a0 100644 (file)
 #include <h/fmt_scan.h>
 #include <h/tws.h>
 #include <h/utils.h>
-#include "../sbr/m_popen.h"
+#include "sbr/m_popen.h"
 #include <setjmp.h>
 #include <sys/types.h>
+#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);
 }