istream.tcc (istream::read): Fix.
2002-04-22 Benjamin Kosnik <bkoz@redhat.com> * include/bits/istream.tcc (istream::read): Fix. * testsuite/27_io/istream_unformatted.cc (main): Add. From-SVN: r52628
This commit is contained in:
parent
232b0b45ca
commit
b2e4f4fda7
|
@ -1,3 +1,8 @@
|
||||||
|
2002-04-22 Benjamin Kosnik <bkoz@redhat.com>
|
||||||
|
|
||||||
|
* include/bits/istream.tcc (istream::read): Fix.
|
||||||
|
* testsuite/27_io/istream_unformatted.cc (main): Add.
|
||||||
|
|
||||||
2002-04-20 Benjamin Kosnik <bkoz@redhat.com>
|
2002-04-20 Benjamin Kosnik <bkoz@redhat.com>
|
||||||
|
|
||||||
PR libstdc++/6360
|
PR libstdc++/6360
|
||||||
|
|
|
@ -777,17 +777,8 @@ namespace std
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
const int_type __eof = traits_type::eof();
|
_M_gcount = this->rdbuf()->sgetn(__s, __n);
|
||||||
__streambuf_type* __sb = this->rdbuf();
|
if (_M_gcount != __n)
|
||||||
int_type __c = __sb->sgetc();
|
|
||||||
|
|
||||||
while (_M_gcount < __n && __c != __eof)
|
|
||||||
{
|
|
||||||
*__s++ = traits_type::to_char_type(__c);
|
|
||||||
++_M_gcount;
|
|
||||||
__c = __sb->snextc();
|
|
||||||
}
|
|
||||||
if (__c == __eof)
|
|
||||||
this->setstate(ios_base::eofbit | ios_base::failbit);
|
this->setstate(ios_base::eofbit | ios_base::failbit);
|
||||||
}
|
}
|
||||||
catch(exception& __fail)
|
catch(exception& __fail)
|
||||||
|
|
|
@ -499,6 +499,20 @@ test08()
|
||||||
VERIFY( c == 'i' );
|
VERIFY( c == 'i' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Theodore Papadopoulo
|
||||||
|
void
|
||||||
|
test09()
|
||||||
|
{
|
||||||
|
using namespace std;
|
||||||
|
bool test = true;
|
||||||
|
|
||||||
|
istringstream iss("Juana Briones");
|
||||||
|
char tab[13];
|
||||||
|
iss.read(tab, 13);
|
||||||
|
if (!iss)
|
||||||
|
test = false;
|
||||||
|
VERIFY( test );
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main()
|
main()
|
||||||
|
@ -511,6 +525,7 @@ main()
|
||||||
test06();
|
test06();
|
||||||
test07();
|
test07();
|
||||||
test08();
|
test08();
|
||||||
|
test09();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue