From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2973 invoked by alias); 19 Nov 2002 14:16:12 -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 2953 invoked by uid 71); 19 Nov 2002 14:16:10 -0000 Resent-Date: 19 Nov 2002 14:16:10 -0000 Resent-Message-ID: <20021119141610.2952.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, castaway@desert-island.m.isar.de Received: (qmail 2231 invoked by uid 61); 19 Nov 2002 14:14:02 -0000 Message-Id: <20021119141402.2230.qmail@sources.redhat.com> Date: Mon, 25 Nov 2002 14:46:00 -0000 From: castaway@desert-island.m.isar.de Reply-To: castaway@desert-island.m.isar.de To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: libstdc++/8637: istream& get (char* s, streamsize n, char delim ) does not work X-SW-Source: 2002-11/txt/msg00948.txt.bz2 List-Id: >Number: 8637 >Category: libstdc++ >Synopsis: istream& get (char* s, streamsize n, char delim ) does not work >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Tue Nov 19 06:16:08 PST 2002 >Closed-Date: >Last-Modified: >Originator: castaway@desert-island.m.isar.de >Release: gcc30-3.0.4-25 (SuSE 8.0) and g++ (GCC) 3.2.1 20021108 >Organization: >Environment: SuSE 8.0 / i686-pc-linux-gnu >Description: 3.0.4 was a standard SuSE 8.0 3.2.1 : --host=i686-pc-linux-gnu --enable-shared --enable-languages=c,c++ --enable-threads=posix --enable-__cxa_atexit --enable- --enable-clocale=gnu istream& get (char* s, streamsize n, char delim ) should read text until the next delimiter given, _and leave the delimiter on the stream_ (worked in 2.95.3) >How-To-Repeat: Example: 1. Create a file with contents "" (double quotes) and nothing else) - programm produces a seg-fault, when run through gdb it produces incorrect output (both delimiters should be ") 2. Create a file with contents "test" - this produces correct output in gcc 3.0.4 but not in 3.2.1. - Both examples work in 2.95.3 // istream get #include #include using namespace std; int main () { char * c, str[256]; ifstream is; char delim; cout << "Enter the name of an existing text file: "; cin.get (str,256); is.open (str); // open file delim = is.get(); cout << "Delimiter: " << delim << endl; is.get(c, 50, '"'); // get character from file cout << c << endl; if(is.fail()) { cout << "Failed" << endl; } delim = is.get(); cout << "Delimiter: " << delim << endl; is.close(); // close file return 0; } >Fix: >Release-Note: >Audit-Trail: >Unformatted: