mailinfo: don't require "text" mime type for attachments
[gitweb.git] / builtin / mailinfo.c
index bfb32b7233850a68bdc226038a9c0f973037499b..2405040ad3c03495ad808c06835d8496bf1fba53 100644 (file)
@@ -19,9 +19,6 @@ static struct strbuf email = STRBUF_INIT;
 static enum  {
        TE_DONTCARE, TE_QP, TE_BASE64
 } transfer_encoding;
-static enum  {
-       TYPE_TEXT, TYPE_OTHER
-} message_type;
 
 static struct strbuf charset = STRBUF_INIT;
 static int patch_lines;
@@ -185,8 +182,6 @@ static void handle_content_type(struct strbuf *line)
        struct strbuf *boundary = xmalloc(sizeof(struct strbuf));
        strbuf_init(boundary, line->len);
 
-       if (!strcasestr(line->buf, "text/"))
-                message_type = TYPE_OTHER;
        if (slurp_attr(line->buf, "boundary=", boundary)) {
                strbuf_insert(boundary, 0, "--", 2);
                if (++content_top > &content[MAX_BOUNDARIES]) {
@@ -671,7 +666,6 @@ static int handle_boundary(void)
        /* set some defaults */
        transfer_encoding = TE_DONTCARE;
        strbuf_reset(&charset);
-       message_type = TYPE_TEXT;
 
        /* slurp in this section's info */
        while (read_one_header_line(&line, fin))
@@ -885,11 +879,6 @@ static void handle_body(void)
                        strbuf_insert(&line, 0, prev.buf, prev.len);
                        strbuf_reset(&prev);
 
-                       /* binary data most likely doesn't have newlines */
-                       if (message_type != TYPE_TEXT) {
-                               handle_filter(&line);
-                               break;
-                       }
                        /*
                         * This is a decoded line that may contain
                         * multiple new lines.  Pass only one chunk