diff options
author | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-07-24 20:47:37 +0000 |
---|---|---|
committer | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-07-24 20:47:37 +0000 |
commit | 14f8fca0ce9044d04803458737bc66911c24008f (patch) | |
tree | a526a1b85ce7234d05d0b65dc897f207bbdbc3b1 | |
parent | 49cdb7e331bf8d0db37f2020ccda4f42b71a1f9b (diff) | |
download | gcc-14f8fca0ce9044d04803458737bc66911c24008f.tar.gz |
2000-07-24 Benjamin Kosnik <bkoz@purist.soma.redhat.com>
* bits/istream.tcc (getline): Tweaks.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@35235 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | libstdc++-v3/ChangeLog | 6 | ||||
-rw-r--r-- | libstdc++-v3/aclocal.m4 | 2 | ||||
-rw-r--r-- | libstdc++-v3/bits/istream.tcc | 9 |
3 files changed, 13 insertions, 4 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 03cb5075aa2..bf6d8f11471 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,10 +1,14 @@ +2000-07-24 Benjamin Kosnik <bkoz@purist.soma.redhat.com> + + * bits/istream.tcc (getline): Tweaks. + 2000-07-23 Brent Verner <brent@rcfile.org> * bits/istream.tcc: istream::getline(char_type*, streamsize, char_type) make compliant * testsuite/27_io/istream_unformatted.cc: test for compliant behavior -2000-07-23 Benjamin Kosnik <bkoz@haight.constant.com> +2000-07-23 Benjamin Kosnik <bkoz@purist.soma.redhat.com> * acinclude.m4 (enable_cshadow_headers): Fix problems with blddir and srcdir used to define CSHADOW_INCLUDES.. diff --git a/libstdc++-v3/aclocal.m4 b/libstdc++-v3/aclocal.m4 index e655e2d07e6..527cbf358a7 100644 --- a/libstdc++-v3/aclocal.m4 +++ b/libstdc++-v3/aclocal.m4 @@ -1520,7 +1520,7 @@ dnl Then, if any (well almost any) other make is called, and GNU make also dnl exists, then the other make wraps the GNU make. dnl dnl @author John Darrington <j.darrington@elvis.murdoch.edu.au> -dnl @version $Id: acinclude.m4,v 1.45 2000/07/21 20:59:23 gdr Exp $ +dnl @version $Id: acinclude.m4,v 1.46 2000/07/24 16:33:55 bkoz Exp $ dnl dnl #### Changes for libstdc++-v3: reformatting and linewrapping; prepending dnl #### GLIBCPP_ to the macro name; adding the :-make fallback in the diff --git a/libstdc++-v3/bits/istream.tcc b/libstdc++-v3/bits/istream.tcc index dc98f521226..f0af22bdfc9 100644 --- a/libstdc++-v3/bits/istream.tcc +++ b/libstdc++-v3/bits/istream.tcc @@ -626,21 +626,26 @@ namespace std { try { __streambuf_type* __sb = this->rdbuf(); int_type __c = __sb->sbumpc(); + ++_M_gcount; const int_type __idelim = traits_type::to_int_type(__delim); const int_type __eof = traits_type::eof(); bool __testdelim = __c == __idelim; bool __testeof = __c == __eof; - while (++_M_gcount < __n && !__testeof && !__testdelim) + while (_M_gcount < __n && !__testeof && !__testdelim) { *__s++ = traits_type::to_char_type(__c); __c = __sb->sbumpc(); + ++_M_gcount; __testeof = __c == __eof; __testdelim = __c == __idelim; } if (__testeof) - this->setstate(ios_base::eofbit); + { + --_M_gcount; + this->setstate(ios_base::eofbit); + } else if (!__testdelim) { --_M_gcount; |