summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fbc9012)
raw | patch | inline | side by side (parent: fbc9012)
author | Junio C Hamano <junkio@cox.net> | |
Mon, 1 Jan 2007 02:18:23 +0000 (18:18 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 1 Jan 2007 02:55:28 +0000 (18:55 -0800) |
We special case the case where encoding recorded in the commit
and the output encoding are the same and do not call iconv().
But we should drop 'encoding' header for this case as well for
consistency.
Signed-off-by: Junio C Hamano <junkio@cox.net>
and the output encoding are the same and do not call iconv().
But we should drop 'encoding' header for this case as well for
consistency.
Signed-off-by: Junio C Hamano <junkio@cox.net>
commit.c | patch | blob | history |
diff --git a/commit.c b/commit.c
index afdf27eeceb76f4f3842ba09b48d07bc218846d6..544e42629e3213a9927134273899d48c6cbe3161 100644 (file)
--- a/commit.c
+++ b/commit.c
else if (!*output_encoding)
return NULL;
encoding = get_header(commit, "encoding");
- if (!encoding || !strcmp(encoding, output_encoding)) {
- free(encoding);
+ if (!encoding)
return NULL;
- }
- out = reencode_string(commit->buffer, output_encoding, encoding);
+ if (!strcmp(encoding, output_encoding))
+ out = strdup(commit->buffer);
+ else
+ out = reencode_string(commit->buffer,
+ output_encoding, encoding);
if (out)
out = replace_encoding_header(out, output_encoding);