[PATCH] Handle variable width encodings in basic_filebuf::seekpos

Pétur Runólfsson peturr02@ru.is
Wed Oct 8 08:13:00 GMT 2003


Hi,

This patch adds support for variable width encodings to
basic_filebuf::seekpos. The necessary code was already present in
seekoff, so I moved it into a separate function (_M_seek) and
called that from both seekoff and seekpos.

While testing the patch, I got a spurious failure in
testsuite/22_locale/locale/cons/12438.cc. It seems the memory limit
was set too low to run the loop even once. I doubled both the
memory limit and the loop count to make the test pass.

Tested on i686-pc-linux-gnu.

Petur

2003-10-07  Petur Runolfsson  <peturr02@ru.is>

	PR libstdc++/9874
	* include/bits/fstream.tcc (basic_filebuf::seekoff):
	Move code needed for both seekoff and seekpos...
	(basic_filebuf::_M_seek): ...here. New function.
	(basic_filebuf::seekpos): Don't call seekoff, call _M_seek.
	* include/std/std_fstream.h (basic_filebuf::_M_seek): Declare it.
	* testsuite/22_locale/locale/cons/12438.cc: Increase memory limit.
	* testsuite/27_io/basic_filebuf/seekpos/wchar_t/9874.cc: New test.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 9874.diff
Type: application/octet-stream
Size: 12280 bytes
Desc: 9874.diff
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20031008/7792cf47/attachment.obj>


More information about the Libstdc++ mailing list