libstdc++/6238: ifstream::getline(...) has problems reading file after long line.
bkoz@gcc.gnu.org
bkoz@gcc.gnu.org
Tue Apr 9 12:16:00 GMT 2002
Synopsis: ifstream::getline(...) has problems reading file after long line.
State-Changed-From-To: analyzed->closed
State-Changed-By: bkoz
State-Changed-When: Tue Apr 9 12:16:21 2002
State-Changed-Why:
This isn't a bug. The specification for getline says that failbit will be set if n items are read without hitting the delimiter. That's what is happening here.
If you change
while(!infile.eof() && record_count < 200)
to
while(infile.good())
You'll get the results you expect.
-benjamin
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6238
More information about the Gcc-prs
mailing list