aboutsummaryrefslogtreecommitdiff
path: root/libio/wfileops.c
diff options
context:
space:
mode:
Diffstat (limited to 'libio/wfileops.c')
-rw-r--r--libio/wfileops.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libio/wfileops.c b/libio/wfileops.c
index 1dbf72f..63cb687 100644
--- a/libio/wfileops.c
+++ b/libio/wfileops.c
@@ -116,6 +116,10 @@ _IO_wfile_underflow (FILE *fp)
enum __codecvt_result status;
ssize_t count;
+ /* C99 requires EOF to be "sticky". */
+ if (fp->_flags & _IO_EOF_SEEN)
+ return WEOF;
+
if (__glibc_unlikely (fp->_flags & _IO_NO_READS))
{
fp->_flags |= _IO_ERR_SEEN;