makemime: content-type should default to application/octet-stream
authorDenys Vlasenko <vda.linux@googlemail.com>
Sat, 19 Nov 2011 12:55:46 +0000 (13:55 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sat, 19 Nov 2011 12:55:46 +0000 (13:55 +0100)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
mailutils/mail.h
mailutils/makemime.c

index d1d7830..fa0c5b3 100644 (file)
@@ -16,22 +16,15 @@ struct globals {
        char *pass;
        FILE *fp0; // initial stdin
        char *opt_charset;
-       char *content_type;
 };
 
 #define G (*ptr_to_globals)
 #define timeout         (G.timeout  )
 #define verbose         (G.verbose  )
 #define opts            (G.opts     )
-//#define user            (G.user     )
-//#define pass            (G.pass     )
-//#define fp0             (G.fp0      )
-//#define opt_charset     (G.opt_charset)
-//#define content_type    (G.content_type)
 #define INIT_G() do { \
        SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \
        G.opt_charset = (char *)CONFIG_FEATURE_MIME_CHARSET; \
-       G.content_type = (char *)"text/plain"; \
 } while (0)
 
 //char FAST_FUNC *parse_url(char *url, char **user, char **pass);
index a9ff03d..f1ef602 100644 (file)
@@ -146,6 +146,7 @@ int makemime_main(int argc UNUSED_PARAM, char **argv)
 {
        llist_t *opt_headers = NULL, *l;
        const char *opt_output;
+       const char *content_type = "application/octet-stream";
 #define boundary opt_output
 
        enum {
@@ -165,7 +166,7 @@ int makemime_main(int argc UNUSED_PARAM, char **argv)
        opt_complementary = "a::";
        opts = getopt32(argv,
                "c:e:o:C:N:a:", //:m:j:",
-               &G.content_type, NULL, &opt_output, &G.opt_charset, NULL, &opt_headers //, NULL, NULL
+               &content_type, NULL, &opt_output, &G.opt_charset, NULL, &opt_headers //, NULL, NULL
        );
        //argc -= optind;
        argv += optind;
@@ -202,7 +203,7 @@ int makemime_main(int argc UNUSED_PARAM, char **argv)
                        "Content-Disposition: inline; filename=\"%s\"\n"
                        "Content-Transfer-Encoding: base64\n"
                        , boundary
-                       , G.content_type
+                       , content_type
                        , G.opt_charset
                        , bb_get_last_path_component_strip(*argv)
                );