blame: fix indent of line numbers

Correct the calculation of the number of digits for line counts of the
form 10^n-1 (9, 99, ...) in lineno_width().  This makes blame stop
printing an extra space before the line numbers of files with that many
total lines.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
René Scharfe
2010-03-13 11:25:12 +01:00
committed by Junio C Hamano
parent 4a2284b999
commit 00fb3d214c
2 changed files with 20 additions and 2 deletions

View File

@ -1772,7 +1772,7 @@ static int lineno_width(int lines)
{
int i, width;
for (width = 1, i = 10; i <= lines + 1; width++)
for (width = 1, i = 10; i <= lines; width++)
i *= 10;
return width;
}