From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20238 invoked by alias); 19 Feb 2003 17:16:02 -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 20134 invoked by uid 71); 19 Feb 2003 17:16:01 -0000 Resent-Date: 19 Feb 2003 17:16:01 -0000 Resent-Message-ID: <20030219171601.20133.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, peturr02@ru.is Received: (qmail 17801 invoked by uid 48); 19 Feb 2003 17:12:35 -0000 Message-Id: <20030219171235.17799.qmail@sources.redhat.com> Date: Wed, 19 Feb 2003 17:16:00 -0000 From: peturr02@ru.is Reply-To: peturr02@ru.is To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: libstdc++/9761: filebuf::pbackfail discards previously put back characters X-SW-Source: 2003-02/txt/msg00947.txt.bz2 List-Id: >Number: 9761 >Category: libstdc++ >Synopsis: filebuf::pbackfail discards previously put back characters >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Wed Feb 19 17:16:01 UTC 2003 >Closed-Date: >Last-Modified: >Originator: peturr02@ru.is >Release: gcc-3.2.1 >Organization: >Environment: Red Hat Linux 8.0 >Description: If filebuf::sputbackc is called twice in a row, the result of the first sputbackc is lost. It would be better for the second sputbackc to fail than to corrupt the stream. Even better would be to support up to gptr() - eback() put backs. >How-To-Repeat: See attachment. >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: text/plain; name="sputbackcbug3.cc" Content-Disposition: inline; filename="sputbackcbug3.cc" #include int main() { using namespace std; filebuf fbuf; fbuf.open("sputbackcbug3.cc", ios_base::in); fbuf.sbumpc(); fbuf.sbumpc(); if (fbuf.sputbackc('a') == EOF) return 0; if (fbuf.sputbackc('b') == EOF) return 0; assert(fbuf.sbumpc() == 'b'); assert(fbuf.sbumpc() == 'a'); return 0; }