From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2479 invoked by alias); 3 Mar 2003 10:56:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 2464 invoked by uid 71); 3 Mar 2003 10:56:01 -0000 Date: Mon, 03 Mar 2003 10:56:00 -0000 Message-ID: <20030303105601.2463.qmail@sources.redhat.com> To: paolo@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Paolo Carlini Subject: Re: libstdc++/9024: Input fails after call to basic_filebuf<>::pubsetbuf(0, 0) Reply-To: Paolo Carlini X-SW-Source: 2003-03/txt/msg00069.txt.bz2 List-Id: The following reply was made to PR libstdc++/9024; it has been noted by GNATS. From: Paolo Carlini To: =?ISO-8859-1?Q?P=E9tur_Run=F3lfsson?= Cc: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org, paolo@gcc.gnu.org, gcc-prs@gcc.gnu.org, bkoz Subject: Re: libstdc++/9024: Input fails after call to basic_filebuf<>::pubsetbuf(0, 0) Date: Mon, 03 Mar 2003 11:45:47 +0100 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.