]> diplodocus.org Git - nmh/blobdiff - uip/burst.c
expect this commit to be force-replaced periodically
[nmh] / uip / burst.c
index 8ed571fb5c1961e7332facedd0ab23418e3dd808..b80d9ce977217d8ffecebee6b21dec6a69748812 100644 (file)
@@ -5,10 +5,31 @@
  * complete copyright information.
  */
 
-#include <h/mh.h>
+#include "h/mh.h"
+#include "sbr/m_name.h"
+#include "sbr/m_gmprot.h"
+#include "sbr/getarguments.h"
+#include "sbr/seq_setprev.h"
+#include "sbr/seq_setcur.h"
+#include "sbr/seq_save.h"
+#include "sbr/smatch.h"
+#include "sbr/m_convert.h"
+#include "sbr/m_backup.h"
+#include "sbr/getfolder.h"
+#include "sbr/ext_hook.h"
+#include "sbr/folder_read.h"
+#include "sbr/folder_realloc.h"
+#include "sbr/folder_free.h"
+#include "sbr/context_save.h"
+#include "sbr/context_replace.h"
+#include "sbr/context_find.h"
+#include "sbr/ambigsw.h"
+#include "sbr/path.h"
+#include "sbr/print_version.h"
+#include "sbr/print_help.h"
 #include "sbr/error.h"
-#include <h/utils.h>
-#include <h/mhparse.h>
+#include "h/utils.h"
+#include "h/mhparse.h"
 #include "h/done.h"
 #include "sbr/m_maildir.h"
 #include "sbr/m_mktemp.h"
@@ -111,13 +132,13 @@ main (int argc, char **argv)
                continue;
 
            case MIMESW:
-               mimesw = 2;
+               mimesw = 2;
                continue;
            case NMIMESW:
-               mimesw = 0;
+               mimesw = 0;
                continue;
            case AUTOMIMESW:
-               mimesw = 1;
+               mimesw = 1;
                continue;
 
            case QIETSW: 
@@ -244,7 +265,7 @@ find_delim (int msgnum, struct smsg *smsgs, int *mimesw)
      */
 
     if (*mimesw > 0) {
-       content = parse_mime(msgnam);
+       content = parse_mime(msgnam);
        if (! content && *mimesw == 2)
            return 0;
        if (content) {
@@ -254,9 +275,9 @@ find_delim (int msgnum, struct smsg *smsgs, int *mimesw)
            find_mime_parts(content, smsgs, &msgp);
            free_content(content);
            if (msgp == 1 && *mimesw == 2)
-               adios (msgnam, "does not have any message/rfc822 parts");
+               adios (msgnam, "does not have any message/rfc822 parts");
            if (msgp > 1) {
-               *mimesw = 1;
+               *mimesw = 1;
                return msgp - 1;
            }
        }
@@ -268,7 +289,7 @@ find_delim (int msgnum, struct smsg *smsgs, int *mimesw)
        adios (msgnam, "unable to read message");
 
     for (msgp = 0, pos = 0L; msgp <= MAXFOLDER;) {
-       /*
+       /*
         * We're either at the beginning of the whole message, or
         * we're just past the delimiter of the last message.
         * Swallow lines until we get to something that's not a newline
@@ -340,7 +361,7 @@ find_mime_parts (CT content, struct smsg *smsgs, int *msgp)
      */
 
     if (content->c_type == CT_MESSAGE &&
-                       content->c_subtype == MESSAGE_RFC822) {
+                       content->c_subtype == MESSAGE_RFC822) {
        smsgs[*msgp].s_start = content->c_begin;
        smsgs[*msgp].s_stop = content->c_end;
        (*msgp)++;
@@ -352,7 +373,7 @@ find_mime_parts (CT content, struct smsg *smsgs, int *msgp)
      */
 
     if (content->c_type == CT_MULTIPART) {
-       m = (struct multipart *) content->c_ctparams;
+       m = (struct multipart *) content->c_ctparams;
 
        for (part = m->mp_parts; part; part = part->mp_next)
            find_mime_parts(part->mp_part, smsgs, msgp);
@@ -413,8 +434,8 @@ burst (struct msgs **mpp, int msgnum, struct smsg *smsgs, int numburst,
      */
     if (inplace) {
        for (i = mp->hghmsg; j > msgnum; i--, j--) {
-           strncpy (f1, m_name (i), sizeof(f1));
-           strncpy (f2, m_name (j), sizeof(f2));
+           strncpy (f1, m_name (i), sizeof(f1) - 1);
+           strncpy (f2, m_name (j), sizeof(f2) - 1);
            if (does_exist (mp, j)) {
                if (verbosw)
                    printf ("message %d becomes message %d\n", j, i);
@@ -462,8 +483,8 @@ burst (struct msgs **mpp, int msgnum, struct smsg *smsgs, int numburst,
            die("unable to create temporary file in %s",
                  get_temp_dir());
        }
-       strncpy (f2, tempfile, sizeof(f2));
-       strncpy (f1, m_name (i), sizeof(f1));
+       strncpy (f2, tempfile, sizeof(f2) - 1);
+       strncpy (f1, m_name (i), sizeof(f1) - 1);
 
        if (verbosw && i != msgnum)
            printf ("message %d of digest %d becomes message %d\n", j, msgnum, i);
@@ -475,7 +496,7 @@ burst (struct msgs **mpp, int msgnum, struct smsg *smsgs, int numburst,
        fclose (out);
 
        if (i == msgnum) {
-           strncpy (f3, m_backup (f1), sizeof(f3));
+           strncpy (f3, m_backup (f1), sizeof(f3) - 1);
            if (rename (f1, f3) == NOTOK)
                admonish (f3, "unable to rename %s to", f1);
 
@@ -556,7 +577,7 @@ cpybrst (FILE *in, FILE *out, char *ifile, char *ofile, int len, int mime)
                break;
 
            case S4:
-               fputc (c, out);
+               fputc (c, out);
                break;
        }
     }