aboutsummaryrefslogtreecommitdiff
path: root/blame.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-03-05 14:46:36 -0800
committerJunio C Hamano <junkio@cox.net>2006-03-05 16:02:44 -0800
commita0fb95e3199810268cfe88c7c4ff0d9958e07062 (patch)
tree92477586ac092b07aa64422477d3cd05b280803f /blame.c
parentea4c7f9bf69e781dd0cd88d2bccb2bf5cc15c9a7 (diff)
downloadgit-a0fb95e3199810268cfe88c7c4ff0d9958e07062.tar.gz
git-a0fb95e3199810268cfe88c7c4ff0d9958e07062.tar.xz
blame: avoid -lm by not using log().
... as suggested on the list. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'blame.c')
-rw-r--r--blame.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/blame.c b/blame.c
index 168b1f5fe..b551dd5aa 100644
--- a/blame.c
+++ b/blame.c
@@ -589,7 +589,7 @@ int main(int argc, const char **argv)
usage(blame_usage);
else if(!strcmp(argv[i], "-l") ||
!strcmp(argv[i], "--long")) {
- sha1_len = 20;
+ sha1_len = 40;
continue;
} else if(!strcmp(argv[i], "-c") ||
!strcmp(argv[i], "--compability")) {
@@ -651,7 +651,9 @@ int main(int argc, const char **argv)
process_commits(&rev, filename, &initial);
buf = blame_contents;
- max_digits = 1 + log(num_blame_lines+1)/log(10);
+ for (max_digits = 1, i = 10; i <= num_blame_lines + 1; max_digits++)
+ i *= 10;
+
for (i = 0; i < num_blame_lines; i++) {
struct commit *c = blame_lines[i];
if (!c)