Merge branch 'zj/decimal-width'

* zj/decimal-width:
  make lineno_width() from blame reusable for others

Conflicts:
	cache.h
	pager.c
This commit is contained in:
Junio C Hamano
2012-02-20 00:15:11 -08:00
3 changed files with 16 additions and 15 deletions

12
pager.c
View File

@@ -147,3 +147,15 @@ int term_columns(void)
return term_columns_at_startup;
}
/*
* How many columns do we need to show this number in decimal?
*/
int decimal_width(int number)
{
int i, width;
for (width = 1, i = 10; i <= number; width++)
i *= 10;
return width;
}