]> diplodocus.org Git - nmh/blobdiff - uip/show.c
SPECS: Alter description to not require a GUI interface.
[nmh] / uip / show.c
index 9430e009e41f68b82b82c33e6a7fa2adf184d029..130ccce8655056077f0f862032f666376636a9b5 100644 (file)
@@ -7,8 +7,9 @@
 
 #include <h/mh.h>
 #include <h/mime.h>
+#include "h/done.h"
 #include <h/utils.h>
-#include "../sbr/m_maildir.h"
+#include "sbr/m_maildir.h"
 
 #define SHOW_SWITCHES \
     X("checkmime", 0, CHECKMIMESW) \
@@ -144,7 +145,7 @@ usage:
                    app_msgarg(&vec, --cp);
                    if (!(cp = *argp++) || *cp == '-')
                        adios (NULL, "missing argument to %s", argp[-2]);
-                   app_msgarg(&vec, getcpy (etcpath(cp)));
+                   app_msgarg(&vec, mh_xstrdup(etcpath(cp)));
                    continue;
 
                case PROGSW:
@@ -188,8 +189,7 @@ usage:
        if (*cp == '+' || *cp == '@') {
            if (folder)
                adios (NULL, "only one folder at a time!");
-           else
-               folder = pluspath (cp);
+            folder = pluspath (cp);
        } else {
            if (mode != SHOW)
                goto usage;
@@ -204,7 +204,7 @@ usage:
        if (msgs.size)
            adios (NULL, "only one file at a time!");
        if (draftsw)
-           app_msgarg(&vec, getcpy (m_draft (folder, NULL, 1, &isdf)));
+           app_msgarg(&vec, mh_xstrdup(m_draft(folder, NULL, 1, &isdf)));
        else
            app_msgarg(&vec, file);
        headersw = 0;
@@ -370,14 +370,14 @@ is_nontext (char *msgnam)
     char *bp, *dp, *cp;
     char buf[NMH_BUFSIZ], name[NAMESZ];
     FILE *fp;
-    m_getfld_state_t gstate = 0;
+    m_getfld_state_t gstate;
 
     if ((fp = fopen (msgnam, "r")) == NULL)
        return 0;
-
+    gstate = m_getfld_state_init(fp);
     for (;;) {
        int bufsz = sizeof buf;
-       switch (state = m_getfld (&gstate, name, buf, &bufsz, fp)) {
+       switch (state = m_getfld2(&gstate, name, buf, &bufsz)) {
        case FLD:
        case FLDPLUS:
            /*
@@ -390,7 +390,7 @@ is_nontext (char *msgnam)
                cp = mh_xstrdup(buf);
                while (state == FLDPLUS) {
                    bufsz = sizeof buf;
-                   state = m_getfld (&gstate, name, buf, &bufsz, fp);
+                   state = m_getfld2(&gstate, name, buf, &bufsz);
                    cp = add (buf, cp);
                }
                bp = cp;
@@ -414,7 +414,7 @@ invalid:
                            continue;
                        case '(':
                            i++;
-                           /* FALLTHRU */
+                           continue;
                        default:
                            continue;
                        case ')':
@@ -495,7 +495,7 @@ out:
                cp = mh_xstrdup(buf);
                while (state == FLDPLUS) {
                    bufsz = sizeof buf;
-                   state = m_getfld (&gstate, name, buf, &bufsz, fp);
+                   state = m_getfld2(&gstate, name, buf, &bufsz);
                    cp = add (buf, cp);
                }
                for (bp = cp; isspace ((unsigned char) *bp); bp++)
@@ -522,7 +522,7 @@ out:
             */
            while (state == FLDPLUS) {
                bufsz = sizeof buf;
-               state = m_getfld (&gstate, name, buf, &bufsz, fp);
+               state = m_getfld2(&gstate, name, buf, &bufsz);
            }
            break;