]> diplodocus.org Git - nmh/blobdiff - uip/burst.c
Added tests of MMDF mailbox format to test-eom-align.
[nmh] / uip / burst.c
index 0f62db74037e9577616959b922b47c3776adb750..5e5d86b9e679df624f5ac14db78e4f29f70b26cc 100644 (file)
@@ -8,6 +8,10 @@
 #include <h/mh.h>
 #include <h/utils.h>
 #include <h/mhparse.h>
+#include "h/done.h"
+#include "sbr/m_maildir.h"
+#include "sbr/m_mktemp.h"
+#include "mhfree.h"
 
 #define BURST_SWITCHES \
     X("inplace", 0, INPLSW) \
@@ -130,8 +134,7 @@ main (int argc, char **argv)
        if (*cp == '+' || *cp == '@') {
            if (folder)
                adios (NULL, "only one folder at a time!");
-           else
-               folder = pluspath (cp);
+            folder = pluspath (cp);
        } else {
            app_msgarg(&msgs, cp);
        }
@@ -172,7 +175,7 @@ main (int argc, char **argv)
            if ((numburst = find_delim (msgnum, smsgs, &mimesw)) >= 1) {
                if (verbosw)
                    printf ("%d message%s exploded from digest %d\n",
-                           numburst, numburst > 1 ? "s" : "", msgnum);
+                           numburst, PLURALS(numburst), msgnum);
                burst (&mp, msgnum, smsgs, numburst, inplace, verbosw,
                       maildir, mimesw);
            } else {
@@ -246,11 +249,11 @@ find_delim (int msgnum, struct smsg *smsgs, int *mimesw)
            msgp = 1;
            find_mime_parts(content, smsgs, &msgp);
            free_content(content);
-           if (msgp == 1 && *mimesw == 2) {
+           if (msgp == 1 && *mimesw == 2)
                adios (msgnam, "does not have any message/rfc822 parts");
-           } else if (msgp > 1) {
+           if (msgp > 1) {
                *mimesw = 1;
-               return (msgp - 1);
+               return msgp - 1;
            }
        }
     }
@@ -290,8 +293,7 @@ find_delim (int msgnum, struct smsg *smsgs, int *mimesw)
        for (c = 0; fgets (buffer, sizeof(buffer), in); c = buffer[0]) {
            if ((wasdlm = CHECKDELIM(buffer)))
                break;
-           else
-               pos += (long) strlen (buffer);
+            pos += (long) strlen (buffer);
        }
 
        /*
@@ -314,7 +316,7 @@ find_delim (int msgnum, struct smsg *smsgs, int *mimesw)
     }
 
     fclose (in);
-    return (msgp - 1);         /* return the number of messages burst */
+    return msgp - 1;           /* return the number of messages burst */
 }