X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin%2Fcommit.c;h=2deccb54447d7f66213414914225a97e79049f74;hb=5e0ec15eb131075d0c3e61b33bcc7931bbc8bc08;hp=eba1377eb32c02e57c46364c381df940afa66048;hpb=cc811d8d020682f0d42d5a53c282df1c1a826540;p=git.git diff --git a/builtin/commit.c b/builtin/commit.c index eba1377eb..2deccb544 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -543,6 +543,7 @@ static void determine_author_info(struct strbuf *author_ident) if (author_message) { const char *a, *lb, *rb, *eol; + size_t len; a = strstr(author_message_buffer, "\nauthor "); if (!a) @@ -563,6 +564,11 @@ static void determine_author_info(struct strbuf *author_ident) (a + strlen("\nauthor ")))); email = xmemdupz(lb + strlen("<"), rb - (lb + strlen("<"))); date = xmemdupz(rb + strlen("> "), eol - (rb + strlen("> "))); + len = eol - (rb + strlen("> ")); + date = xmalloc(len + 2); + *date = '@'; + memcpy(date + 1, rb + strlen("> "), len); + date[len + 1] = '\0'; } if (force_author) {