extern int rcachesw; /* mhcachesbr.c */
extern int wcachesw; /* mhcachesbr.c */
-/*
- * Directory to place tmp files. This must
- * be set before these routines are called.
- */
-char *tmp;
-
pid_t xpid = 0;
static char prefix[] = "----- =_aaaaaaaaaa";
*/
CT
-build_mime (char *infile, int autobuild, int directives, int header_encoding)
+build_mime (char *infile, int autobuild, int dist, int directives,
+ int header_encoding)
{
int compnum, state;
char buf[BUFSIZ], name[NAMESZ];
entry = mh_xmalloc(sizeof(*entry));
entry->filename = getcpy(s);
+ entry->next = NULL;
free(vp);
+
if (attach_tail) {
attach_tail->next = entry;
attach_tail = entry;
* Now add the MIME-Version header field
* to the list of header fields.
*/
- np = add (VRSN_FIELD, NULL);
- vp = concat (" ", VRSN_VALUE, "\n", NULL);
- add_header (ct, np, vp);
+
+ if (! dist) {
+ np = add (VRSN_FIELD, NULL);
+ vp = concat (" ", VRSN_VALUE, "\n", NULL);
+ add_header (ct, np, vp);
+ }
/*
* We initally assume we will find multiple contents in the
}
/* Build the rest of the header field structures */
- build_headers (ct);
+ if (! dist)
+ build_headers (ct);
return ct;
}
FILE *out;
char *cp;
- cp = m_mktemp2(NULL, invo_name, NULL, &out);
- if (cp == NULL) adios("mhbuildsbr", "unable to create temporary file");
+ if ((cp = m_mktemp2(NULL, invo_name, NULL, &out)) == NULL) {
+ adios("mhbuildsbr", "unable to create temporary file in %s",
+ get_temp_dir());
+ }
/* use a temp file to collect the plain text lines */
ce->ce_file = add (cp, NULL);
if (!(cp = ci->ci_magic))
adios (NULL, "internal error(5)");
- tfile = m_mktemp2(NULL, invo_name, NULL, NULL);
- if (tfile == NULL) {
- adios("mhbuildsbr", "unable to create temporary file");
- }
+ if ((tfile = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) {
+ adios("mhbuildsbr", "unable to create temporary file in %s",
+ get_temp_dir());
+ }
ce->ce_file = add (tfile, NULL);
ce->ce_unlink = 1;