diff --git a/strbuf.c b/strbuf.c index 654330849c..672a1e4097 100644 --- a/strbuf.c +++ b/strbuf.c @@ -37,6 +37,8 @@ void read_line(struct strbuf *sb, FILE *fp, int term) { break; strbuf_add(sb, ch); } + if (ch == EOF && sb->len == 0) + sb->eof = 1; strbuf_end(sb); }