Coding style adjustments for nmh-imported code
[mmh] / uip / mhbuild.c
index 140cfdb..1fdedb6 100644 (file)
@@ -319,6 +319,7 @@ build_mime(char *infile)
        struct part **pp;
        CT ct;
        FILE *in;
+       HF hp;
 
        umask(~m_gmprot());
 
@@ -411,6 +412,16 @@ finish_field:
        }
 
        /*
+       ** 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, NULL)) {
+                       adios(EX_DATAERR, NULL, "Unable to encode header \"%s\"", hp->name);
+               }
+       }
+
+       /*
        ** Now add the MIME-Version header field
        ** to the list of header fields.
        */
@@ -1529,6 +1540,9 @@ build_headers(CT ct)
        if (ct->c_descr) {
                np = getcpy(DESCR_FIELD);
                vp = concat(" ", ct->c_descr, NULL);
+               if (encode_rfc2047(DESCR_FIELD, &vp, NULL)) {
+                       adios(EX_DATAERR, NULL, "Unable to encode %s header", DESCR_FIELD);
+               }
                add_header(ct, np, vp);
        }