From: Junio C Hamano Date: Sat, 11 Jul 2009 03:18:09 +0000 (-0700) Subject: Merge branch 'ae/maint-mailinfo-rm-only-one-patch-marker' X-Git-Tag: v1.6.4-rc1~17 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/73ccb916e4e733745e1361739b07f1ef3e97ae6b?ds=inline;hp=-c Merge branch 'ae/maint-mailinfo-rm-only-one-patch-marker' * ae/maint-mailinfo-rm-only-one-patch-marker: mailinfo: Remove only one set of square brackets --- 73ccb916e4e733745e1361739b07f1ef3e97ae6b diff --combined builtin-mailinfo.c index 92637ac0ba,be42532d43..fb5ad70f3f --- a/builtin-mailinfo.c +++ b/builtin-mailinfo.c @@@ -193,7 -193,8 +193,7 @@@ static void handle_content_type(struct *content_top = boundary; boundary = NULL; } - if (slurp_attr(line->buf, "charset=", &charset)) - strbuf_tolower(&charset); + slurp_attr(line->buf, "charset=", &charset); if (boundary) { strbuf_release(boundary); @@@ -221,6 -222,8 +221,8 @@@ static void cleanup_subject(struct strb { char *pos; size_t remove; + int brackets_removed = 0; + while (subject->len) { switch (*subject->buf) { case 'r': case 'R': @@@ -235,10 -238,15 +237,15 @@@ strbuf_remove(subject, 0, 1); continue; case '[': + /* remove only one set of square brackets */ + if (brackets_removed) + break; + if ((pos = strchr(subject->buf, ']'))) { remove = pos - subject->buf; if (remove <= (subject->len - remove) * 2) { strbuf_remove(subject, 0, remove + 1); + brackets_removed = 1; continue; } } else @@@ -480,7 -488,7 +487,7 @@@ static const char *guess_charset(const if (is_utf8(line->buf)) return NULL; } - return "latin1"; + return "ISO8859-1"; } static void convert_to_utf8(struct strbuf *line, const char *charset) @@@ -493,7 -501,7 +500,7 @@@ return; } - if (!strcmp(metainfo_charset, charset)) + if (!strcasecmp(metainfo_charset, charset)) return; out = reencode_string(line->buf, metainfo_charset, charset); if (!out) @@@ -549,6 -557,7 +556,6 @@@ static int decode_header_bq(struct strb if (cp + 3 - it->buf > it->len) goto decode_header_bq_out; strbuf_add(&charset_q, ep, cp - ep); - strbuf_tolower(&charset_q); encoding = cp[1]; if (!encoding || cp[2] != '?') @@@ -942,7 -951,7 +949,7 @@@ int cmd_mailinfo(int argc, const char * */ git_config(git_default_config, NULL); - def_charset = (git_commit_encoding ? git_commit_encoding : "utf-8"); + def_charset = (git_commit_encoding ? git_commit_encoding : "UTF-8"); metainfo_charset = def_charset; while (1 < argc && argv[1][0] == '-') { diff --combined t/t5100/sample.mbox index c3074ac573,ba4d0c9baf..3a757d7d8f --- a/t/t5100/sample.mbox +++ b/t/t5100/sample.mbox @@@ -99,7 -99,7 +99,7 @@@ index 9123cdc..918dcf8 10064 From nobody Sat Aug 27 23:07:49 2005 Path: news.gmane.org!not-for-mail Message-ID: <20050721.091036.01119516.yoshfuji@linux-ipv6.org> -From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= +From: YOSHIFUJI Hideaki / =?ISO-2022-JP?B?GyRCNUhGIzFRTEAbKEI=?= Newsgroups: gmane.comp.version-control.git Subject: [PATCH 1/2] GIT: Try all addresses for given remote name @@@ -218,7 -218,7 +218,7 @@@ GPG-FP : 9022 65EB 1ECF 3AD1 0BDF 80D From nobody Sat Aug 27 23:07:49 2005 Path: news.gmane.org!not-for-mail Message-ID: -From: =?iso-8859-1?Q?David_K=E5gedal?= +From: =?ISO8859-1?Q?David_K=E5gedal?= Newsgroups: gmane.comp.version-control.git Subject: [PATCH] Fixed two bugs in git-cvsimport-script. Date: Mon, 15 Aug 2005 20:18:25 +0200 @@@ -226,7 -226,7 +226,7 @@@ Lines: 8 Approved: news@gmane.org NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 -Content-Type: text/plain; charset=iso-8859-1 +Content-Type: text/plain; charset=ISO8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Trace: sea.gmane.org 1124130247 31839 80.91.229.2 (15 Aug 2005 18:24:07 GMT) X-Complaints-To: usenet@sea.gmane.org @@@ -476,7 -476,7 +476,7 @@@ MIME-Version: 1. Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= -Content-Type: text/plain; charset=iso-8859-15 +Content-Type: text/plain; charset=ISO8859-15 Content-Transfer-Encoding: quoted-printable Here comes a commit log message, and @@@ -514,7 -514,7 +514,7 @@@ MIME-Version: 1. Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit - Subject: [Navy-patches] [PATCH] + Subject: [PATCH] [Navy-patches] =?utf-8?b?0JjQt9C80LXQvdGR0L0g0YHQv9C40YHQvtC6INC/0LA=?= =?utf-8?b?0LrQtdGC0L7QsiDQvdC10L7QsdGF0L7QtNC40LzRi9GFINC00LvRjyA=?= =?utf-8?b?0YHQsdC+0YDQutC4?=