This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libstdc++/6238: ifstream::getline(...) has problems reading file after long line.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]