Commit 28f7869dee25de082045591fac0876323b062a64

schu 2011-06-20T17:25:13

gitfo_read: fix read-loop Signed-off-by: schu <schu-github@schulog.org>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/src/fileops.c b/src/fileops.c
index c2a3ff0..2a5eb74 100644
--- a/src/fileops.c
+++ b/src/fileops.c
@@ -90,10 +90,8 @@ int gitfo_read(git_file fd, void *buf, size_t cnt)
 				continue;
 			return git__throw(GIT_EOSERR, "Failed to read from file");
 		}
-		if (!r) {
-			errno = EPIPE;
-			return git__throw(GIT_EOSERR, "Failed to read from file");
-		}
+		if (!r)
+			break;
 		cnt -= r;
 		b += r;
 	}