Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc')
-rw-r--r--newlib/libc/stdio/rget.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/newlib/libc/stdio/rget.c b/newlib/libc/stdio/rget.c
index a9a0d2f2f..38e8b5dd1 100644
--- a/newlib/libc/stdio/rget.c
+++ b/newlib/libc/stdio/rget.c
@@ -39,6 +39,11 @@ __srget_r (struct _reent *ptr,
we call __srefill_r so we may access the true read buffer. */
CHECK_INIT(ptr, fp);
+ /* Have to set and check orientation here, otherwise the macros in
+ stdio.h never set it. */
+ if (ORIENT (fp, -1) != -1)
+ return EOF;
+
if (__srefill_r (ptr, fp) == 0)
{
fp->_r--;