[PATCH] Diff-files fix with more tests.
[git.git] / strbuf.c
index d381c1d..672a1e4 100644 (file)
--- a/strbuf.c
+++ b/strbuf.c
@@ -37,7 +37,7 @@ void read_line(struct strbuf *sb, FILE *fp, int term) {
                        break;
                strbuf_add(sb, ch);
        }
-       if (sb->len == 0)
+       if (ch == EOF && sb->len == 0)
                sb->eof = 1;
        strbuf_end(sb);
 }