re PR libstdc++/12868 (basic_filebuf::imbue fails too easily)
authorPaolo Carlini <pcarlini@suse.de>
Tue, 18 Nov 2003 08:21:38 +0000 (08:21 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Tue, 18 Nov 2003 08:21:38 +0000 (08:21 +0000)
commit2934246345f8f64dfcf01a9ea79e3bb1279c877c
treedaa2ff7e839fcb7ddd139eef47a4d6daedfcfab6
parent0ec5fef2187bc6f4f962e3afe1b2d829b7474d80
re PR libstdc++/12868 (basic_filebuf::imbue fails too easily)

2003-11-18  Paolo Carlini  <pcarlini@suse.de>

PR libstdc++/12868
* include/bits/fstream.tcc (imbue): For encodings != -1 it's
always ok to imbue a new locale, provided seekoff(0, cur, ...)
doesn't fail, of course.
(underflow): In order for the above to work, deal gracefully
with _M_codecvt->in returning codecvt_base::error while
(__ilen = __iend - this->eback()) > 0: it just means __ilen
correctly converted internal characters before an error.
* testsuite/27_io/basic_filebuf/imbue/wchar_t/12868.cc: New.

From-SVN: r73697
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/fstream.tcc
libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/12868.cc [new file with mode: 0644]