From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10900 invoked by alias); 20 Mar 2003 09:06: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 10874 invoked by uid 71); 20 Mar 2003 09:06:00 -0000 Resent-Date: 20 Mar 2003 09:06:00 -0000 Resent-Message-ID: <20030320090600.10873.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, achim.herwig@chemie.uni-erlangen.de Received: (qmail 7077 invoked by uid 48); 20 Mar 2003 09:00:31 -0000 Message-Id: <20030320090031.7076.qmail@sources.redhat.com> Date: Thu, 20 Mar 2003 09:06:00 -0000 From: achim.herwig@chemie.uni-erlangen.de Reply-To: achim.herwig@chemie.uni-erlangen.de To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: libstdc++/10163: std::operator>>(istream&, string&) reads whole file X-SW-Source: 2003-03/txt/msg01324.txt.bz2 List-Id: >Number: 10163 >Category: libstdc++ >Synopsis: std::operator>>(istream&, string&) reads whole file >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Thu Mar 20 09:06:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: achim.herwig@chemie.uni-erlangen.de >Release: GCC-3.2.2 >Organization: >Environment: Linux 2.4.17, glibc 2.2.2 >Description: The operator>> on a string does not only read a single word, but the whole file. This is at least (I don't have the standard at hand) contrary to what Josuttis writes in his book and contrary to the other GCC versions I know (including 3.2). -- stream.cpp --- // If it worked correctly, only the // would appear! #include #include #include using namespace std; int main (int argc, char** argv) { ifstream is("stream.cpp"); // This file. string line; is >> line ; cout << line << endl; } >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: