@matheusbsbs / matheus-bagliano / commits / 4621af3716
Fork 0

--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 c0ce981f5ebfd02463ff697b2fca52c7a54b0625 1174889646 -0700 Signed-off-by: Jeff King <peff@peff.net> Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>

Jeff King committed Mar 27, 2007 at 19:26 UTC 4621af371686f5c787c172c285562ad997281821
1 file changed +1 -1
commit.c
+1 -1
@@ -760,7 +760,7 @@ static void fill_person(struct interp *table, const char *msg, int len)
760 if (msg + start == ep)
761 return;
762
763 - table[5].value = xstrndup(msg + start, ep - msg + start);
763 + table[5].value = xstrndup(msg + start, ep - (msg + start));
764
765 /* parse tz */
766 for (start = ep - msg + 1; start < len && isspace(msg[start]); start++)