Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
diff --cc: a lost line at the beginning of the file is shown incorrectly
[gitweb.git]
/
refs.c
diff --git
a/refs.c
b/refs.c
index 90163bdc56868151e4fd45ff77aa3bd56db45573..bb0762ee2bcb736e72db1c0bbda0604246f14c15 100644
(file)
--- a/
refs.c
+++ b/
refs.c
@@
-1525,8
+1525,10
@@
int for_each_recent_reflog_ent(const char *ref, each_reflog_ent_fn fn, long ofs,
if (fstat(fileno(logfp), &statbuf) ||
statbuf.st_size < ofs ||
fseek(logfp, -ofs, SEEK_END) ||
- fgets(buf, sizeof(buf), logfp))
+ fgets(buf, sizeof(buf), logfp)) {
+ fclose(logfp);
return -1;
+ }
}
while (fgets(buf, sizeof(buf), logfp)) {