Browse Source

git-pickaxe: fix nth_line()

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>
maint
Junio C Hamano 18 years ago
parent
commit
1ca6ca876e
  1. 3
      builtin-pickaxe.c

3
builtin-pickaxe.c

@ -1085,6 +1085,9 @@ static int prepare_lines(struct scoreboard *sb) @@ -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;
}

Loading…
Cancel
Save