about summary refs log tree commit diff
path: root/libio/iofwide.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-08-09 08:50:50 +0000
committerUlrich Drepper <drepper@redhat.com>2001-08-09 08:50:50 +0000
commit40a982a9e1b825b175be7bc7c7199c6bdf363e4b (patch)
tree7523a21da3e35bed6e56133efbe1d16dadb6e6da /libio/iofwide.c
parent0f78390bd799fc0b0394240a9a704591481ac8c6 (diff)
downloadglibc-40a982a9e1b825b175be7bc7c7199c6bdf363e4b.tar.gz
glibc-40a982a9e1b825b175be7bc7c7199c6bdf363e4b.tar.xz
glibc-40a982a9e1b825b175be7bc7c7199c6bdf363e4b.zip
Update.
2001-08-09  Ulrich Drepper  <drepper@redhat.com>

	* libio/wfileops.c (_IO_wfile_seekoff): Don't even try to handle
	seeking with backup buffer present.
	Correct determining of internal buffer position.
	Reset also wide buffers if we reset the internal buffers.
	* libio/iofwide.c (_IO_fwide): Always determine file offset for wide
	streams.
	* libio/ioseekoff.c: Catch one unimplemented case.
	* libio/ftello.c: Don't abort if the wide stream has backup buffer.
	* libio/ftello64.c: Likewise.
	* libio/iofgetpos.c: Likewise.
	* libio/iofgetpos64.c: Likewise.
	* libio/ftell.c: Likewise.
	* libio/Makefile (tests): Add tst-ungetwc2.
	* libio/tst-ungetwc2.c: New file.
Diffstat (limited to 'libio/iofwide.c')
-rw-r--r--libio/iofwide.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libio/iofwide.c b/libio/iofwide.c
index aa314fe671..88d2d5e563 100644
--- a/libio/iofwide.c
+++ b/libio/iofwide.c
@@ -201,6 +201,12 @@ _IO_fwide (fp, mode)
 
       /* From now on use the wide character callback functions.  */
       ((struct _IO_FILE_plus *) fp)->vtable = fp->_wide_data->_wide_vtable;
+
+      /* One last twist: we get the current stream position.  The wide
+	 char streams have much more problems with not knowing the
+	 current position and so we should disable the optimization
+	 which allows the functions without knowing the position.  */
+      fp->_offset = _IO_SYSSEEK (fp, 0, 0);
     }
 
   /* Set the mode now.  */