summaryrefslogtreecommitdiff
path: root/builtin/mailinfo.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-11-15 18:24:05 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-11-15 18:24:05 (GMT)
commit6b8731258d06001217254ef67a3553d3fe601737 (patch)
tree8f31842c4331b0bfc784453df25955b9718b0029 /builtin/mailinfo.c
parenta1b3293936e3ee3a431051d12744876e4f5b21eb (diff)
parent0e18bcd5e937b9e5857892e7f5c80c3c5b1da5d4 (diff)
downloadgit-6b8731258d06001217254ef67a3553d3fe601737.zip
git-6b8731258d06001217254ef67a3553d3fe601737.tar.gz
git-6b8731258d06001217254ef67a3553d3fe601737.tar.bz2
Merge branch 'jc/same-encoding'
Various codepaths checked if two encoding names are the same using ad-hoc code and some of them ended up asking iconv() to convert between "utf8" and "UTF-8". The former is not a valid way to spell the encoding name, but often people use it by mistake, and we equated them in some but not all codepaths. Introduce a new helper function to make these codepaths consistent. * jc/same-encoding: reencode_string(): introduce and use same_encoding() Conflicts: builtin/mailinfo.c
Diffstat (limited to 'builtin/mailinfo.c')
-rw-r--r--builtin/mailinfo.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/mailinfo.c b/builtin/mailinfo.c
index da23140..24a772d 100644
--- a/builtin/mailinfo.c
+++ b/builtin/mailinfo.c
@@ -483,7 +483,8 @@ static void convert_to_utf8(struct strbuf *line, const char *charset)
if (!charset || !*charset)
return;
- if (!strcasecmp(metainfo_charset, charset))
+
+ if (same_encoding(metainfo_charset, charset))
return;
out = reencode_string(line->buf, metainfo_charset, charset);
if (!out)