projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added mhbuild: -nocontentid to profile used for tests, to simplify
[mmh]
/
uip
/
sendsbr.c
diff --git
a/uip/sendsbr.c
b/uip/sendsbr.c
index
3865258
..
08dc766
100644
(file)
--- a/
uip/sendsbr.c
+++ b/
uip/sendsbr.c
@@
-63,7
+63,7
@@
static int sendaux (char **, int, char *, struct stat *);
static int attach(char *, char *, int);
static void clean_up_temporary_files(void);
static int get_line(void);
static int attach(char *, char *, int);
static void clean_up_temporary_files(void);
static int get_line(void);
-static void make_mime_composition_file_entry(char *, int);
+static void make_mime_composition_file_entry(char *, int, char *);
/*
/*
@@
-292,10
+292,13
@@
attach(char *attachment_header_field_name, char *draft_file_name,
/*
* Add a mhbuild MIME composition file line for the body if there was one.
/*
* Add a mhbuild MIME composition file line for the body if there was one.
+ * Set the default content type to text/plain so that mhbuild takes care
+ * of any necessary encoding.
*/
if (has_body)
*/
if (has_body)
- make_mime_composition_file_entry(body_file_name, attachformat);
+ make_mime_composition_file_entry(body_file_name, attachformat,
+ "text/plain");
/*
* Now, go back to the beginning of the draft file and look for header fields
/*
* Now, go back to the beginning of the draft file and look for header fields
@@
-314,7
+317,10
@@
attach(char *attachment_header_field_name, char *draft_file_name,
for (p = field + length + 1; *p == ' ' || *p == '\t'; p++)
;
for (p = field + length + 1; *p == ' ' || *p == '\t'; p++)
;
- make_mime_composition_file_entry(p, attachformat);
+ /* Don't set the default content type so take
+ make_mime_composition_file_entry() will try to infer it
+ from the file type. */
+ make_mime_composition_file_entry(p, attachformat, 0);
}
}
}
}
@@
-382,7
+388,8
@@
get_line(void)
}
static void
}
static void
-make_mime_composition_file_entry(char *file_name, int attachformat)
+make_mime_composition_file_entry(char *file_name, int attachformat,
+ char *default_content_type)
{
int binary; /* binary character found flag */
int c; /* current character */
{
int binary; /* binary character found flag */
int c; /* current character */
@@
-393,7
+400,7
@@
make_mime_composition_file_entry(char *file_name, int attachformat)
char *p; /* miscellaneous string pointer */
struct stat st; /* file status buffer */
char *p; /* miscellaneous string pointer */
struct stat st; /* file status buffer */
- content_type = (char *)0;
+ content_type = default_content_type;
/*
* Check the file name for a suffix. Scan the context for that suffix on a
/*
* Check the file name for a suffix. Scan the context for that suffix on a