]> diplodocus.org Git - nmh/blobdiff - uip/mhbuildsbr.c
That didn't work, try adding -pedantic-errors.
[nmh] / uip / mhbuildsbr.c
index 07358cd356b0c6a69119a718253e6207d7d25751..e449917092e185d5934cf3579ddaa81373998ec4 100644 (file)
@@ -19,7 +19,6 @@
 #include <fcntl.h>
 #include <h/signals.h>
 #include <h/md5.h>
-#include <signal.h>
 #include <h/mts.h>
 #include <h/tws.h>
 #include <h/mime.h>
@@ -70,11 +69,6 @@ int find_cache (CT, int, int *, char *, char *, int);
 void free_ctinfo (CT);
 void free_encoding (CT, int);
 
-/*
- * prototypes
- */
-CT build_mime (char *, int);
-
 /*
  * static prototypes
  */
@@ -129,7 +123,7 @@ static void directive_pop(void)
  */
 
 CT
-build_mime (char *infile, int directives)
+build_mime (char *infile, int directives, int header_encoding)
 {
     int        compnum, state;
     char buf[BUFSIZ], name[NAMESZ];
@@ -138,6 +132,7 @@ build_mime (char *infile, int directives)
     struct part **pp;
     CT ct;
     FILE *in;
+    HF hp;
     m_getfld_state_t gstate = 0;
 
     directive_init(directives);
@@ -228,6 +223,17 @@ finish_field:
     }
     m_getfld_state_destroy (&gstate);
 
+    /*
+     * Iterate through the list of headers and call the function to MIME-ify
+     * them if required.
+     */
+
+    for (hp = ct->c_first_hf; hp != NULL; hp = hp->next) {
+       if (encode_rfc2047(hp->name, &hp->value, header_encoding, NULL)) {
+           adios(NULL, "Unable to encode header \"%s\"", hp->name);
+       }
+    }
+
     /*
      * Now add the MIME-Version header field
      * to the list of header fields.