This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: libstdc++/9024: Input fails after call to basic_filebuf<>::pubsetbuf(0,0)
- From: Paolo Carlini <pcarlini at unitus dot it>
- To: Pétur Runólfsson <peturr02 at ru dot is>
- Cc: gcc-gnats at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, paolo at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, bkoz <bkoz at redhat dot com>
- Date: Mon, 03 Mar 2003 11:45:47 +0100
- Subject: Re: libstdc++/9024: Input fails after call to basic_filebuf<>::pubsetbuf(0,0)
- References: <07D05A69A3D0C14FAEA60C3ACE8E5564028D0DBB@nike.hir.is>
Pétur Runólfsson wrote:
A memo: while working on a fix for libstdc++/9423 (quite easy
by itself),
finally seems obvious how to fix 9024: in _M_underflow_common add a
separate case for !__testget && !__testinit, which simply calls
_M_file.xsgetn(&__c, 1) and returns __ret =
traits_type::to_int_type(__c).
Does this work when codecvt::encoding() != 1 ?
One thing at a time Pétur!
Your problem report was about plain chars, right?
Eventually, _M_underflow_common(wchar_t) will obviously include
something along
these lines (the approach works, by the way), taking into account
encoding() to fetch the
appropriate number of external bytes decoded to get one internal char,
together with other
fixes for 9178 and 9875.
Paolo.