From 442685a8ba011460eb27ad83855d05c9c9345aa6 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 26 Aug 2002 08:08:50 +0000 Subject: Update. 2002-08-26 Ulrich Drepper * libio/wfileops.c (_IO_wfile_seekoff): Set fp->_offset after finding the read position [PR libc/4265]. * libio/Makefile (tests): Add bug-rewind2. * libio/bug-rewind2.c: New file. --- libio/wfileops.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'libio/wfileops.c') diff --git a/libio/wfileops.c b/libio/wfileops.c index e9fe55bba5..02933b730e 100644 --- a/libio/wfileops.c +++ b/libio/wfileops.c @@ -674,7 +674,7 @@ _IO_wfile_seekoff (fp, offset, dir, mode) + (sizeof (buffer) / sizeof (buffer[0])), &ignore); - if (status != __codecvt_ok && status != __codecvt_partial) + if (status != __codecvt_ok && status != __codecvt_partial) { fp->_flags |= _IO_ERR_SEEN; goto dumb; @@ -682,6 +682,10 @@ _IO_wfile_seekoff (fp, offset, dir, mode) } while (read_ptr_copy != fp->_IO_read_ptr); + fp->_offset = (fp->_offset + - (fp->_IO_read_end - fp->_IO_read_base) + + rel_offset); + fp->_wide_data->_IO_read_ptr = fp->_wide_data->_IO_read_end = fp->_wide_data->_IO_read_base; -- cgit 1.4.1