Skip to content

Commit

Permalink
strbuf.c: remove unnecessary strbuf_grow() from strbuf_getwholeline()
Browse files Browse the repository at this point in the history
This use of strbuf_grow() is a historical artifact that was once used to
ensure that strbuf.buf was allocated and properly nul-terminated.  This
was added before the introduction of the slopbuf in b315c5c, which
guarantees that strbuf.buf always points to a usable nul-terminated string.
So let's remove it.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Brandon Casey authored and Junio C Hamano committed Oct 18, 2011
1 parent 16b3b2d commit 1844f8d
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion strbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,6 @@ int strbuf_getwholeline(struct strbuf *sb, FILE *fp, int term)
{
int ch;

strbuf_grow(sb, 0);
if (feof(fp))
return EOF;

Expand Down

0 comments on commit 1844f8d

Please sign in to comment.