]> git.marmaro.de Git - mmh/blobdiff - uip/mhbuild.c
Coding style adjustments for nmh-imported code
[mmh] / uip / mhbuild.c
index 140cfdb39dc669f5704e28559ef7cd8d9138570d..1fdedb6612f3d66c9e977d502e4f6e44ce23df01 100644 (file)
@@ -319,6 +319,7 @@ build_mime(char *infile)
        struct part **pp;
        CT ct;
        FILE *in;
+       HF hp;
 
        umask(~m_gmprot());
 
@@ -410,6 +411,16 @@ finish_field:
                break;
        }
 
+       /*
+       ** 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);
        }