Code

Fix "--pretty=format:" encoding item
authorJeff King <peff@peff.net>
Wed, 28 Mar 2007 21:09:05 +0000 (17:09 -0400)
committerJunio C Hamano <junkio@cox.net>
Wed, 28 Mar 2007 21:27:43 +0000 (14:27 -0700)
It printed the header "encoding " instead of just showing
the encoding, as all other items do.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
commit.c

index 9ac533c85ab25f54cda97a0976f21a3232cf72ca..a4f2e74c0b9b17a467fd9c4d3f5a2d275d5ea038 100644 (file)
--- a/commit.c
+++ b/commit.c
@@ -888,7 +888,8 @@ static long format_commit_message(const struct commit *commit,
                        fill_person(table + ICOMMITTER_NAME,
                                        msg + i + 10, eol - i - 10);
                else if (!prefixcmp(msg + i, "encoding "))
-                       table[IENCODING].value = xstrndup(msg + i, eol - i);
+                       table[IENCODING].value =
+                               xstrndup(msg + i + 9, eol - i - 9);
                i = eol;
        }
        if (msg[i])