]> diplodocus.org Git - nmh/blobdiff - uip/mhparse.c
Restored test-ali to its prior condition. It failed on the
[nmh] / uip / mhparse.c
index 39a701dbf17c6931cb726e12a71d5f6e1bf02679..381887663e7e20491b7f2a5cc2305599378f12c7 100644 (file)
@@ -276,6 +276,7 @@ get_content (FILE *in, char *file, int toplevel)
      * Parse the header fields for this
      * content into a linked list.
      */
+    m_getfld_track_filepos (&gstate, in);
     for (compnum = 1;;) {
        int bufsz = sizeof buf;
        switch (state = m_getfld (&gstate, name, buf, &bufsz, in)) {
@@ -1120,9 +1121,22 @@ InitMultiPart (CT ct)
      */
     if (ct->c_encoding != CE_7BIT && ct->c_encoding != CE_8BIT
        && ct->c_encoding != CE_BINARY) {
+       /* Copy the Content-Transfer-Encoding header field body so we can
+          remove any trailing whitespace and leading blanks from it. */
+       char *cte = add (ct->c_celine ? ct->c_celine : "(null)", NULL);
+
+       bp = cte + strlen (cte) - 1;
+       while (bp >= cte && isspace (*bp)) *bp-- = '\0';
+       for (bp = cte; *bp && isblank (*bp); ++bp) continue;
+
        admonish (NULL,
-                 "\"%s/%s\" type in message %s must be encoded in 7bit, 8bit, or binary",
-                 ci->ci_type, ci->ci_subtype, ct->c_file);
+                 "\"%s/%s\" type in message %s must be encoded in\n"
+                 "7bit, 8bit, or binary, per RFC 2045 (6.4).  One workaround "
+                 "is to\nmanually edit the file and change the \"%s\"\n"
+                 "Content-Transfer-Encoding to one of those.  For now",
+                 ci->ci_type, ci->ci_subtype, ct->c_file, bp);
+       free (cte);
+
        return NOTOK;
     }
 
@@ -2614,7 +2628,7 @@ openFTP (CT ct, char **file)
 
        fflush (stdout);
 
-       for (i = 0; (child_id = vfork()) == NOTOK && i < 5; i++)
+       for (i = 0; (child_id = fork()) == NOTOK && i < 5; i++)
            sleep (5);
        switch (child_id) {
            case NOTOK:
@@ -2756,7 +2770,7 @@ openMail (CT ct, char **file)
     vec[vecp++] = e->eb_body;
     vec[vecp] = NULL;
 
-    for (i = 0; (child_id = vfork()) == NOTOK && i < 5; i++)
+    for (i = 0; (child_id = fork()) == NOTOK && i < 5; i++)
        sleep (5);
     switch (child_id) {
        case NOTOK: