]> diplodocus.org Git - nmh/blobdiff - uip/mhbuildsbr.c
mhstoresbr.c: Flip if-condition so return moves from else block.
[nmh] / uip / mhbuildsbr.c
index a615dcf9704bd55ed484f051bf02ad0c64c0a35b..9c5bd92a7cec676dca45f76e9f2d62c7c7d5a754 100644 (file)
@@ -22,6 +22,8 @@
 #include <h/mime.h>
 #include <h/mhparse.h>
 #include <h/utils.h>
+#include "h/mhcachesbr.h"
+#include "mhmisc.h"
 #include "../sbr/m_mktemp.h"
 #include "../sbr/message_id.h"
 #include "../sbr/mime_type.h"
@@ -55,12 +57,6 @@ typedef struct convert_list {
 } convert_list;
 
 
-/* mhmisc.c */
-void content_error (char *, CT, char *, ...);
-
-/* mhcachesbr.c */
-int find_cache (CT, int, int *, char *, char *, int);
-
 /*
  * static prototypes
  */
@@ -590,7 +586,7 @@ init_decoded_content (CT ct, const char *filename)
     ct->c_ceclosefnx = close_encoding;
     ct->c_cesizefnx  = NULL;           /* since unencoded */
     ct->c_encoding = CE_7BIT;          /* Seems like a reasonable default */
-    ct->c_file = add(filename, NULL);
+    ct->c_file = mh_xstrdup(FENDNULL(filename));
 
     return OK;
 }
@@ -1225,7 +1221,7 @@ compose_content (CT ct, int verbose)
     default:
        if (!ce->ce_file) {
            pid_t child_id;
-           int i, xstdout, len, buflen;
+           int xstdout, len, buflen;
            char *bp, *cp;
            char *vec[4], buffer[BUFSIZ];
            FILE *out;
@@ -1325,8 +1321,7 @@ raw:
            if ((out = fopen (ce->ce_file, "w")) == NULL)
                adios (ce->ce_file, "unable to open for writing");
 
-           for (i = 0; (child_id = fork()) == NOTOK && i > 5; i++)
-               sleep (5);
+           child_id = fork();
            switch (child_id) {
            case NOTOK:
                adios ("fork", "unable to fork");
@@ -2241,9 +2236,9 @@ expand_pseudoheader (CT ct, CT *text_plain_ct, struct multipart *m,
     init_decoded_content (reply_ct, infile);
 
     if (extract_headers (reply_ct, reply_file, &reply_fp) == NOTOK) {
-        free (reply_file);
         inform("failed to extract headers from convert output in %s, "
            "continuing...", reply_file);
+        free(reply_file);
         return;
     }