diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2008-03-11 19:08:39 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2008-03-11 19:08:39 +0000 |
commit | 88348faf5b464209aed4e508547cf9411b1dd98f (patch) | |
tree | 2ecd0206234d873dba743a8d512be85985dd4310 /newlib/libc/stdio | |
parent | 5b7296f63732d346f1748efe89d8c5d38389edbb (diff) | |
download | cygnal-88348faf5b464209aed4e508547cf9411b1dd98f.tar.gz cygnal-88348faf5b464209aed4e508547cf9411b1dd98f.tar.bz2 cygnal-88348faf5b464209aed4e508547cf9411b1dd98f.zip |
2008-03-11 Jeff Johnston <jjohnstn@redhat.com>
* libc/stdio/rgetc.c (__srget): Invoke CHECK_INIT to ensure
stdin gets resolved properly before refilling.
Diffstat (limited to 'newlib/libc/stdio')
-rw-r--r-- | newlib/libc/stdio/rget.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/newlib/libc/stdio/rget.c b/newlib/libc/stdio/rget.c index 0444acee3..0a1cc147f 100644 --- a/newlib/libc/stdio/rget.c +++ b/newlib/libc/stdio/rget.c @@ -36,6 +36,10 @@ _DEFUN(__srget_r, (ptr, fp), struct _reent *ptr _AND register FILE *fp) { + /* Ensure that any fake std stream is resolved before + we call __srefill_r so we may access the true read buffer. */ + CHECK_INIT(fp); + if (__srefill_r (ptr, fp) == 0) { fp->_r--; |