summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7ed863a)
raw | patch | inline | side by side (parent: 7ed863a)
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | |
Sun, 23 Oct 2011 11:51:34 +0000 (22:51 +1100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 24 Oct 2011 04:33:58 +0000 (21:33 -0700) |
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
pretty.c | patch | blob | history |
diff --git a/pretty.c b/pretty.c
index 85499347514ec3e1d62d6caa9f53b886c556e345..34d668cc300b63650094202745850e45063a4d72 100644 (file)
--- a/pretty.c
+++ b/pretty.c
{
struct format_commit_context context;
static const char utf8[] = "UTF-8";
- const char *enc;
const char *output_enc = pretty_ctx->output_encoding;
memset(&context, 0, sizeof(context));
context.wrap_start = sb->len;
context.message = commit->buffer;
if (output_enc) {
- enc = get_header(commit, "encoding");
- enc = enc ? enc : utf8;
- if (strcmp(enc, output_enc))
+ char *enc = get_header(commit, "encoding");
+ if (strcmp(enc ? enc : utf8, output_enc))
context.message = logmsg_reencode(commit, output_enc);
+ free(enc);
}
strbuf_expand(sb, format, format_commit_item, &context);