From a756bab867e70b63d215123451bede9dd01486dd Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 25 Jul 2000 18:55:52 +0000 Subject: [PATCH] (_IO_wfile_underflow): Correct not entirely empty external buffer correctly. --- libio/wfileops.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/libio/wfileops.c b/libio/wfileops.c index 52368abb60..45c9120f34 100644 --- a/libio/wfileops.c +++ b/libio/wfileops.c @@ -179,9 +179,6 @@ _IO_wfile_underflow (fp) fp->_IO_read_base = fp->_IO_read_ptr = fp->_IO_read_end = fp->_IO_buf_base; - fp->_IO_write_base = fp->_IO_write_ptr = fp->_IO_write_end = - fp->_IO_buf_base; - if (fp->_IO_buf_base == NULL) { /* Maybe we already have a push back pointer. */ @@ -191,8 +188,14 @@ _IO_wfile_underflow (fp) fp->_flags &= ~_IO_IN_BACKUP; } _IO_doallocbuf (fp); + + fp->_IO_read_base = fp->_IO_read_ptr = fp->_IO_read_end = + fp->_IO_buf_base; } + fp->_IO_write_base = fp->_IO_write_ptr = fp->_IO_write_end = + fp->_IO_buf_base; + if (fp->_wide_data->_IO_buf_base == NULL) { /* Maybe we already have a push back pointer. */ @@ -211,11 +214,6 @@ _IO_wfile_underflow (fp) _IO_switch_to_get_mode (fp); - fp->_IO_read_base = fp->_IO_read_ptr = fp->_IO_buf_base; - fp->_IO_read_end = fp->_IO_buf_base; - fp->_IO_write_base = fp->_IO_write_ptr = fp->_IO_write_end - = fp->_IO_buf_base; - fp->_wide_data->_IO_read_base = fp->_wide_data->_IO_read_ptr = fp->_wide_data->_IO_buf_base; fp->_wide_data->_IO_read_end = fp->_wide_data->_IO_buf_base;