提交 4621af37 编写于 作者: J Jeff King 提交者: Junio C Hamano

--pretty=format: fix broken %ct and %at interpolation

A pointer arithmetic error in fill_person caused random data
from the commit object to be included with the timestamp,
which looked something like:

    $ git-rev-list --pretty=format:%ct origin/next | head
    commit 98453bdb3db10db26099749bc4f2dc029bed9aa9
    1174977948 -0700

    Merge branch 'master' into next

    * master:
      Bisect: Use
    commit c0ce981f
    1174889646 -0700
Signed-off-by: NJeff King <peff@peff.net>
Acked-by: NJohannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: NJunio C Hamano <junkio@cox.net>
上级 c6e0caa3
......@@ -760,7 +760,7 @@ static void fill_person(struct interp *table, const char *msg, int len)
if (msg + start == ep)
return;
table[5].value = xstrndup(msg + start, ep - msg + start);
table[5].value = xstrndup(msg + start, ep - (msg + start));
/* parse tz */
for (start = ep - msg + 1; start < len && isspace(msg[start]); start++)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册