]> diplodocus.org Git - nmh/blobdiff - uip/mhlsbr.c
get_file_info(): Flip logic throughout, reducing nesting.
[nmh] / uip / mhlsbr.c
index 1aad69680103b7b2fee423635fc6361f5cb025c5..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:
@@ -397,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:
@@ -420,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;
 
@@ -437,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;
 
@@ -1647,8 +1647,7 @@ mhldone (int status)
     exitstat = status;
     if (mhl_action)
        longjmp (mhlenv, DONE);
-    else
-       done (exitstat);
+    done (exitstat);
 }