]> diplodocus.org Git - nmh/blobdiff - uip/mhbuildsbr.c
Minimized message files reads in m_getfld() when the caller
[nmh] / uip / mhbuildsbr.c
index 6a7443e9f11d0a9aa29ae6b8a34d81a7a06970cb..c7164b32e457ac4c293c5caad9097007c26fe5d7 100644 (file)
@@ -163,7 +163,8 @@ build_mime (char *infile, int directives)
      * the new MIME message.
      */
     for (compnum = 1, state = FLD;;) {
-       switch (state = m_getfld (state, name, buf, sizeof(buf), in)) {
+       int bufsz = sizeof buf;
+       switch (state = m_getfld (state, name, buf, &bufsz, in)) {
        case FLD:
        case FLDPLUS:
        case FLDEOF:
@@ -179,8 +180,10 @@ build_mime (char *infile, int directives)
 
            /* ignore any Content-Type fields in the header */
            if (!mh_strcasecmp (name, TYPE_FIELD)) {
-               while (state == FLDPLUS)
-                   state = m_getfld (state, name, buf, sizeof(buf), in);
+               while (state == FLDPLUS) {
+                   bufsz = sizeof buf;
+                   state = m_getfld (state, name, buf, &bufsz, in);
+               }
                goto finish_field;
            }
 
@@ -190,7 +193,8 @@ build_mime (char *infile, int directives)
 
            /* if necessary, get rest of field */
            while (state == FLDPLUS) {
-               state = m_getfld (state, name, buf, sizeof(buf), in);
+               bufsz = sizeof buf;
+               state = m_getfld (state, name, buf, &bufsz, in);
                vp = add (buf, vp);     /* add to previous value */
            }
 
@@ -1549,11 +1553,6 @@ skip_headers:
     switch (ct->c_encoding) {
     case CE_7BIT:
        /* Nothing to output */
-#if 0
-       np = add (ENCODING_FIELD, NULL);
-       vp = concat (" ", "7bit", "\n", NULL);
-       add_header (ct, np, vp);
-#endif
        break;
 
     case CE_8BIT: