diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2011-11-19 13:55:46 +0100 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2011-11-19 13:55:46 +0100 |
| commit | 3bc4fc5857e2daba601442f95771a590bce915bc (patch) | |
| tree | 9ba4897cd937b33d33860945f9655fb9d37170b7 | |
| parent | 578b8171511f67a9c2afc5c6ae9745de9f9b5e42 (diff) | |
| download | busybox-w32-3bc4fc5857e2daba601442f95771a590bce915bc.tar.gz busybox-w32-3bc4fc5857e2daba601442f95771a590bce915bc.tar.bz2 busybox-w32-3bc4fc5857e2daba601442f95771a590bce915bc.zip | |
makemime: content-type should default to application/octet-stream
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| -rw-r--r-- | mailutils/mail.h | 7 | ||||
| -rw-r--r-- | mailutils/makemime.c | 5 |
2 files changed, 3 insertions, 9 deletions
diff --git a/mailutils/mail.h b/mailutils/mail.h index d1d783055..fa0c5b378 100644 --- a/mailutils/mail.h +++ b/mailutils/mail.h | |||
| @@ -16,22 +16,15 @@ struct globals { | |||
| 16 | char *pass; | 16 | char *pass; |
| 17 | FILE *fp0; // initial stdin | 17 | FILE *fp0; // initial stdin |
| 18 | char *opt_charset; | 18 | char *opt_charset; |
| 19 | char *content_type; | ||
| 20 | }; | 19 | }; |
| 21 | 20 | ||
| 22 | #define G (*ptr_to_globals) | 21 | #define G (*ptr_to_globals) |
| 23 | #define timeout (G.timeout ) | 22 | #define timeout (G.timeout ) |
| 24 | #define verbose (G.verbose ) | 23 | #define verbose (G.verbose ) |
| 25 | #define opts (G.opts ) | 24 | #define opts (G.opts ) |
| 26 | //#define user (G.user ) | ||
| 27 | //#define pass (G.pass ) | ||
| 28 | //#define fp0 (G.fp0 ) | ||
| 29 | //#define opt_charset (G.opt_charset) | ||
| 30 | //#define content_type (G.content_type) | ||
| 31 | #define INIT_G() do { \ | 25 | #define INIT_G() do { \ |
| 32 | SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \ | 26 | SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \ |
| 33 | G.opt_charset = (char *)CONFIG_FEATURE_MIME_CHARSET; \ | 27 | G.opt_charset = (char *)CONFIG_FEATURE_MIME_CHARSET; \ |
| 34 | G.content_type = (char *)"text/plain"; \ | ||
| 35 | } while (0) | 28 | } while (0) |
| 36 | 29 | ||
| 37 | //char FAST_FUNC *parse_url(char *url, char **user, char **pass); | 30 | //char FAST_FUNC *parse_url(char *url, char **user, char **pass); |
diff --git a/mailutils/makemime.c b/mailutils/makemime.c index a9ff03d03..f1ef602a4 100644 --- a/mailutils/makemime.c +++ b/mailutils/makemime.c | |||
| @@ -146,6 +146,7 @@ int makemime_main(int argc UNUSED_PARAM, char **argv) | |||
| 146 | { | 146 | { |
| 147 | llist_t *opt_headers = NULL, *l; | 147 | llist_t *opt_headers = NULL, *l; |
| 148 | const char *opt_output; | 148 | const char *opt_output; |
| 149 | const char *content_type = "application/octet-stream"; | ||
| 149 | #define boundary opt_output | 150 | #define boundary opt_output |
| 150 | 151 | ||
| 151 | enum { | 152 | enum { |
| @@ -165,7 +166,7 @@ int makemime_main(int argc UNUSED_PARAM, char **argv) | |||
| 165 | opt_complementary = "a::"; | 166 | opt_complementary = "a::"; |
| 166 | opts = getopt32(argv, | 167 | opts = getopt32(argv, |
| 167 | "c:e:o:C:N:a:", //:m:j:", | 168 | "c:e:o:C:N:a:", //:m:j:", |
| 168 | &G.content_type, NULL, &opt_output, &G.opt_charset, NULL, &opt_headers //, NULL, NULL | 169 | &content_type, NULL, &opt_output, &G.opt_charset, NULL, &opt_headers //, NULL, NULL |
| 169 | ); | 170 | ); |
| 170 | //argc -= optind; | 171 | //argc -= optind; |
| 171 | argv += optind; | 172 | argv += optind; |
| @@ -202,7 +203,7 @@ int makemime_main(int argc UNUSED_PARAM, char **argv) | |||
| 202 | "Content-Disposition: inline; filename=\"%s\"\n" | 203 | "Content-Disposition: inline; filename=\"%s\"\n" |
| 203 | "Content-Transfer-Encoding: base64\n" | 204 | "Content-Transfer-Encoding: base64\n" |
| 204 | , boundary | 205 | , boundary |
| 205 | , G.content_type | 206 | , content_type |
| 206 | , G.opt_charset | 207 | , G.opt_charset |
| 207 | , bb_get_last_path_component_strip(*argv) | 208 | , bb_get_last_path_component_strip(*argv) |
| 208 | ); | 209 | ); |
