summaryrefslogtreecommitdiff
path: root/libc/stdio
diff options
context:
space:
mode:
authorManuel Novoa III <mjn3@codepoet.org>2001-07-25 22:31:25 +0000
committerManuel Novoa III <mjn3@codepoet.org>2001-07-25 22:31:25 +0000
commit75f21a11e173f38e7ead2eff119314482b803a65 (patch)
tree82e9e257111ef54184c956a8c5e44c262a297cc1 /libc/stdio
parent5838c4acc08947c7bf643afcef12726899edc004 (diff)
Ok... the fix wasn't quite so straightforward. Hopefully this will do it.
Diffstat (limited to 'libc/stdio')
-rw-r--r--libc/stdio/stdio.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libc/stdio/stdio.c b/libc/stdio/stdio.c
index d6c950fd0..34ee50347 100644
--- a/libc/stdio/stdio.c
+++ b/libc/stdio/stdio.c
@@ -420,6 +420,9 @@ off_t _uClibc_fread(unsigned char *buf, off_t bytes, FILE *fp)
fp->bufpos = fp->bufread = fp->bufstart; /* Reset pointers. */
fp->bufread += _uClibc_fread(fp->bufstart,
fp->bufend - fp->bufstart, fp);
+ if (fp->bufread - fp->bufstart >= bytes) { /* If we read all */
+ fp->mode |= ~__MODE_EOF; /* that was requested, make sure */
+ } /* EOF flag is clear. */
goto FROM_BUF;
}