[bug] istream::getline(char*,streamsize) still broken
Benjamin Kosnik
bkoz@redhat.com
Thu Jul 20 22:31:00 GMT 2000
> | over it - 1 (4) would be incorrect.
>
> ...hmm
>
> 27.6.1.3 says:
extracts chars and stores them into successive locaitons of an aray whos
first element is designated by S. Characters are extracted and stored
until one of the following occurs:
1) eof
2) c == delim
3) n - 1 stored
conditions tested in order shown
> ... so we canmust extract n characters
no, not if n - 1 are stored. Then no more are extracted...
> character is the delimiter. I still believe the patch to istream.cc
> will enforce proper behavior. It does cause a couple of failures (bad
> tests IMO) in the testsuite, which I will address/justify when I get
> a breather :) I _seriously_ believe the tests in the original message
> accurately enforce the std.
Hmm. You haven't proven your case
;)
In anycase, a patch that admits testcase breakage is probably a better
way to go, so next time at least note that things broke (or make the
changes and add commentary--which is by far the superior solution.)
best,
benjamin
More information about the Libstdc++
mailing list