projects
/
git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1617baa
)
git-pickaxe: fix nth_line()
author
Junio C Hamano
<junkio@cox.net>
Sat, 21 Oct 2006 01:48:18 +0000
(18:48 -0700)
committer
Junio C Hamano
<junkio@cox.net>
Sat, 21 Oct 2006 01:48:18 +0000
(18:48 -0700)
We would want to be able to refer to the end of the file as
"the beginning of Nth line" for a file that is N lines long.
Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-pickaxe.c
patch
|
blob
|
history
diff --git
a/builtin-pickaxe.c
b/builtin-pickaxe.c
index 74c7c9a33b1a3fe6c2a49dd2ba426431451c9fed..b595299bf8f3ec7361ec7afe5fe7515502d60730 100644
(file)
--- a/
builtin-pickaxe.c
+++ b/
builtin-pickaxe.c
@@
-1085,6
+1085,9
@@
static int prepare_lines(struct scoreboard *sb)
bol = 1;
}
}
+ sb->lineno = xrealloc(sb->lineno,
+ sizeof(int* ) * (num + incomplete + 1));
+ sb->lineno[num + incomplete] = buf - sb->final_buf;
sb->num_lines = num + incomplete;
return sb->num_lines;
}