projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Set up remotes/origin to track all remote branches.
[git.git]
/
strbuf.c
diff --git
a/strbuf.c
b/strbuf.c
index
6543308
..
9d9d8be
100644
(file)
--- a/
strbuf.c
+++ b/
strbuf.c
@@
-4,7
+4,7
@@
#include "cache.h"
void strbuf_init(struct strbuf *sb) {
- sb->buf =
0
;
+ sb->buf =
NULL
;
sb->eof = sb->alloc = sb->len = 0;
}
@@
-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);
}