Commit f2f5472f by Benjamin Kosnik Committed by Benjamin Kosnik

streambuf.tcc (__copy_streambufs): Don't set eofbit.


2001-06-26  Benjamin Kosnik  <bkoz@fillmore.constant.com>
	                     <vakatov@ncbi.nlm.nih.gov>

	libstdc++/3272
	* include/bits/streambuf.tcc (__copy_streambufs): Don't set eofbit.
	* testsuite/27_io/ostream_inserter_other.cc (test04): Add test.
	* testsuite/27_io/istream_extractor_other.cc: Fix.

From-SVN: r43602
parent e979f9e8
2001-06-26 Benjamin Kosnik <bkoz@fillmore.constant.com>
<vakatov@ncbi.nlm.nih.gov>
libstdc++/3272
* include/bits/streambuf.tcc (__copy_streambufs): Don't set eofbit.
* testsuite/27_io/ostream_inserter_other.cc (test04): Add test.
* testsuite/27_io/istream_extractor_other.cc: Fix.
2001-06-26 Zoltan Hidvegi <hzoli@austin.ibm.com> 2001-06-26 Zoltan Hidvegi <hzoli@austin.ibm.com>
* acinclude.m4 (glibcpp_toolexeclibdir): Make multilib safe. * acinclude.m4 (glibcpp_toolexeclibdir): Make multilib safe.
......
...@@ -206,12 +206,8 @@ namespace std { ...@@ -206,12 +206,8 @@ namespace std {
__sbin->_M_in_cur_move(__xtrct); __sbin->_M_in_cur_move(__xtrct);
if (__xtrct == __bufsize) if (__xtrct == __bufsize)
{ {
int_type __c = __sbin->sgetc(); if (__sbin->sgetc() == _Traits::eof())
if (__c == _Traits::eof()) break;
{
__ios.setstate(ios_base::eofbit);
break;
}
__bufsize = __sbin->in_avail(); __bufsize = __sbin->in_avail();
} }
else else
......
...@@ -128,9 +128,9 @@ bool test01() { ...@@ -128,9 +128,9 @@ bool test01() {
state1 = is_04.rdstate(); state1 = is_04.rdstate();
is_04 >> &isbuf_03; is_04 >> &isbuf_03;
state2 = is_04.rdstate(); state2 = is_04.rdstate();
VERIFY( state1 != state2 ); VERIFY( state1 == state2 );
VERIFY( !static_cast<bool>(state2 & statefail) ); VERIFY( !static_cast<bool>(state2 & statefail) );
VERIFY( state2 == stateeof ); VERIFY( state2 != stateeof );
strtmp = isbuf_03.str(); strtmp = isbuf_03.str();
VERIFY( strtmp == str_02 ); // as only an "in" buffer VERIFY( strtmp == str_02 ); // as only an "in" buffer
VERIFY( isbuf_03.sgetc() == 'a' ); VERIFY( isbuf_03.sgetc() == 'a' );
......
// 1999-08-16 bkoz // 1999-08-16 bkoz
// 1999-11-01 bkoz // 1999-11-01 bkoz
// Copyright (C) 1999, 2000 Free Software Foundation // Copyright (C) 1999, 2000, 2001 Free Software Foundation
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -134,6 +134,21 @@ test03(void) ...@@ -134,6 +134,21 @@ test03(void)
return 0; return 0;
} }
// libstdc++/3272
void test04()
{
using namespace std;
bool test = true;
istringstream istr("inside betty carter");
ostringstream ostr;
ostr << istr.rdbuf() << endl;
if (ostr.rdstate() & ios_base::eofbit)
test = false;
VERIFY( test );
}
int int
main() main()
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment