peek should set eofbit if sgetc() returns eof.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@167238 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4af2cf38f0
commit
73c85c7725
@ -1189,7 +1189,11 @@ basic_istream<_CharT, _Traits>::peek()
|
|||||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||||
sentry __sen(*this, true);
|
sentry __sen(*this, true);
|
||||||
if (__sen)
|
if (__sen)
|
||||||
|
{
|
||||||
__r = this->rdbuf()->sgetc();
|
__r = this->rdbuf()->sgetc();
|
||||||
|
if (traits_type::eq_int_type(__r, traits_type::eof()))
|
||||||
|
this->setstate(ios_base::eofbit);
|
||||||
|
}
|
||||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user