From: Junio C Hamano Date: Sat, 26 Nov 2005 07:36:58 +0000 (-0800) Subject: name-rev: fix off-by-one error in --stdin. X-Git-Tag: v0.99.9l^2~58 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2d76d0d151239538c43b61572283405b10df43ac;p=git.git name-rev: fix off-by-one error in --stdin. It dropped the last hexdigit in the object name. [jc: Noticed and patch supplied by ALASCM, reworked to apply at the right place by me] Signed-off-by: Junio C Hamano --- diff --git a/name-rev.c b/name-rev.c index 817e36b79..7d89401a4 100644 --- a/name-rev.c +++ b/name-rev.c @@ -217,10 +217,9 @@ int main(int argc, char **argv) if (!strcmp(name, "undefined")) continue; - fwrite(p_start, p - p_start, 1, stdout); - fputc('(', stdout); - fputs(name, stdout); - fputc(')', stdout); + fwrite(p_start, p - p_start + 1, 1, + stdout); + printf(" (%s)", name); p_start = p + 1; } }