]> diplodocus.org Git - nmh/blobdiff - uip/mhbuildsbr.c
uip/mhparse.c: Fix body starting a byte too soon when no blank line.
[nmh] / uip / mhbuildsbr.c
index f26c81bede7cc110372368b7219cc52a7d119a21..501bb88baa4fee91bf59a32664384b0aad2d771b 100644 (file)
 #include <h/md5.h>
 #include <h/mts.h>
 #include <h/tws.h>
+#include <h/fmt_scan.h>
 #include <h/mime.h>
 #include <h/mhparse.h>
 #include <h/utils.h>
+#include "../sbr/m_mktemp.h"
+#include "../sbr/message_id.h"
+#include "../sbr/mime_type.h"
+#include "mhfree.h"
+#include "mhshowsbr.h"
 
 #ifdef HAVE_SYS_TIME_H
 # include <sys/time.h>
@@ -34,10 +40,6 @@ extern int listsw;
 extern int rfc934sw;
 extern int contentidsw;
 
-/* cache policies */
-extern int rcachesw;   /* mhcachesbr.c */
-extern int wcachesw;   /* mhcachesbr.c */
-
 static char prefix[] = "----- =_aaaaaaaaaa";
 
 struct attach_list {
@@ -59,12 +61,6 @@ void content_error (char *, CT, char *, ...);
 /* mhcachesbr.c */
 int find_cache (CT, int, int *, char *, char *, int);
 
-/* mhfree.c */
-extern CT *cts;
-void freects_done (int) NORETURN;
-void free_ctinfo (CT);
-void free_encoding (CT, int);
-
 /*
  * static prototypes
  */
@@ -131,7 +127,7 @@ build_mime (char *infile, int autobuild, int dist, int directives,
            int header_encoding, size_t maxunencoded, int verbose)
 {
     int        compnum, state;
-    char buf[BUFSIZ], name[NAMESZ];
+    char buf[NMH_BUFSIZ], name[NAMESZ];
     char *cp, *np, *vp;
     struct multipart *m;
     struct part **pp;
@@ -335,7 +331,7 @@ finish_field:
 
        case BODY:
            fseek (in, (long) (-strlen (buf)), SEEK_CUR);
-           /* FALLTHRU */
+           break;
        case FILEEOF:
            break;
 
@@ -649,7 +645,7 @@ user_content (FILE *in, char *buf, CT *ctp, const char *infilename)
 {
     int        extrnal, vrsn;
     char *cp, **ap;
-    char buffer[BUFSIZ];
+    char buffer[NMH_BUFSIZ];
     struct multipart *m;
     struct part **pp;
     struct stat st;
@@ -1772,7 +1768,7 @@ skip_headers:
      */
     if (checksw) {
        np = mh_xstrdup(MD5_FIELD);
-       vp = calculate_digest (ct, (ct->c_encoding == CE_QUOTED) ? 1 : 0);
+        vp = calculate_digest (ct, ct->c_encoding == CE_QUOTED);
        add_header (ct, np, vp);
     }
 
@@ -2066,7 +2062,7 @@ set_disposition (CT ct) {
                "continuing...", invo_name,
                ct->c_ctinfo.ci_type,
                ct->c_ctinfo.ci_subtype ? "/" : "",
-               ct->c_ctinfo.ci_subtype ? ct->c_ctinfo.ci_subtype : "",
+               FENDNULL(ct->c_ctinfo.ci_subtype),
                cp);
         }
 
@@ -2231,7 +2227,7 @@ expand_pseudoheader (CT ct, CT *text_plain_ct, struct multipart *m,
     /* reply_file is used to pass the output of the convert. */
     reply_file = getcpy (m_mktemp2 (NULL, invo_name, NULL, NULL));
     convert_command =
-        concat (convert, " ", argstring ? argstring : "", " >", reply_file,
+        concat (convert, " ", FENDNULL(argstring), " >", reply_file,
                 NULL);
 
     /* Convert here . . . */