diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-02-20 00:15:11 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-02-20 00:15:11 -0800 |
commit | 4d9e079e826c9b51b610260564111fa8385f7581 (patch) | |
tree | 13a4e3a16efd510b3b15a2ce55cf3caeb00857aa /pager.c | |
parent | 583c389e7e431583de4fd8f6c06495a9b015c528 (diff) | |
parent | ec7ff5ba272b565ed093a98dc13dd5cd26aeac92 (diff) | |
download | git-4d9e079e826c9b51b610260564111fa8385f7581.tar.gz |
Merge branch 'zj/decimal-width'
* zj/decimal-width:
make lineno_width() from blame reusable for others
Conflicts:
cache.h
pager.c
Diffstat (limited to 'pager.c')
-rw-r--r-- | pager.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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; +} |