aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-10-08 11:32:59 -0700
committerJunio C Hamano <gitster@pobox.com>2012-10-08 11:33:00 -0700
commit6e2035715e35988917a88b14da3bbbce8351d920 (patch)
tree43fa886a1d7ab6d8a5fdbdc4fe46d83a7d7a4c69 /builtin
parent9376c8603fc1f9b5bf663b76705dfee77f71ef82 (diff)
parent9d55b2e12f82b344709b0f2981eaf142b0b1f7a8 (diff)
downloadgit-6e2035715e35988917a88b14da3bbbce8351d920.tar.gz
git-6e2035715e35988917a88b14da3bbbce8351d920.tar.xz
Merge branch 'lt/mailinfo-handle-attachment-more-sanely' into maint
A patch attached as application/octet-stream (e.g. not text/*) were mishandled, not correctly honoring Content-Transfer-Encoding (e.g. base64). * lt/mailinfo-handle-attachment-more-sanely: mailinfo: don't require "text" mime type for attachments
Diffstat (limited to 'builtin')
-rw-r--r--builtin/mailinfo.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/builtin/mailinfo.c b/builtin/mailinfo.c
index 9973bd909..fe128572f 100644
--- a/builtin/mailinfo.c
+++ b/builtin/mailinfo.c
@@ -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;
@@ -184,8 +181,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]) {
@@ -681,7 +676,6 @@ again:
/* 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))
@@ -895,11 +889,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