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:
authorEric Blake <eblake@redhat.com>2008-03-04 05:22:36 +0300
committerEric Blake <eblake@redhat.com>2008-03-04 05:22:36 +0300
commit9ae00e9e07beb3bca4d81e18dd5209e0d9234644 (patch)
treeb052594d6f8fa7653ab3cccb9497bb8af6646397 /newlib/libc/stdio/fflush.c
parentbe62101c605591b8cd8764d283d274d0defe749b (diff)
Fix ftell bug after ungetc.
* libc/stdio/ftell.c (_ftell_r): Don't flush ungetc buffer on ftell. * libc/stdio64/ftello64.c (_ftello64_r): Likewise. * libc/stdio/fflush.c (_fflush_r): Clear unget buffer when repositioning underlying fd offset. -------------------------------------------------------------------
Diffstat (limited to 'newlib/libc/stdio/fflush.c')
-rw-r--r--newlib/libc/stdio/fflush.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/newlib/libc/stdio/fflush.c b/newlib/libc/stdio/fflush.c
index 24bd6c10e..33e2e7b26 100644
--- a/newlib/libc/stdio/fflush.c
+++ b/newlib/libc/stdio/fflush.c
@@ -164,6 +164,8 @@ _DEFUN(_fflush_r, (ptr, fp),
fp->_p = fp->_bf._base;
if (fp->_flags & __SOFF)
fp->_offset = curoff;
+ if (HASUB (fp))
+ FREEUB (ptr, fp);
}
else
{