From: jjohnstn Date: Wed, 24 Oct 2001 18:10:28 +0000 (+0000) Subject: 2001-10-24 Christopher Faylor X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=462fd19fe0e72a792ee11e0116f4c14e07cef9af;p=pf3gnuchains%2Fsourceware.git 2001-10-24 Christopher Faylor * libc/stdio/fseek.c: Reset pointer to buffer base when forced to seek outside of current buffer contents. This prevents the code from erroneously thinking there is anything in the current buffer. --- diff --git a/newlib/ChangeLog b/newlib/ChangeLog index dbf7db16f6..4ecd47a458 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,10 @@ +2001-10-24 Christopher Faylor + + * libc/stdio/fseek.c: Reset pointer to buffer base + when forced to seek outside of current buffer contents. + This prevents the code from erroneously thinking there is + anything in the current buffer. + 2001-10-22 Geoffrey Keating * libc/include/math.h: The C++ standard adds the single-precision diff --git a/newlib/libc/stdio/fseek.c b/newlib/libc/stdio/fseek.c index d22292e97e..1b72989145 100644 --- a/newlib/libc/stdio/fseek.c +++ b/newlib/libc/stdio/fseek.c @@ -278,6 +278,7 @@ fseek (fp, offset, whence) if ((*seekfn) (fp->_cookie, curoff, SEEK_SET) == POS_ERR) goto dumb; fp->_r = 0; + fp->_p = fp->_bf._base; if (HASUB (fp)) FREEUB (fp); fp->_flags &= ~__SEOF;