commit | 66e7ed959f9373f8596650e94b4176fe694be72a | [log] [tgz] |
---|---|---|
author | Howard Hinnant <hhinnant@apple.com> | Thu Nov 01 17:32:07 2012 +0000 |
committer | Howard Hinnant <hhinnant@apple.com> | Thu Nov 01 17:32:07 2012 +0000 |
tree | 6e4648508af61828efa7289f444c4e32ef21a518 | |
parent | 4eaf8ef5cbc1a41a4add1a72de7cc12f3df68f60 [diff] [blame] |
peek should set eofbit if sgetc() returns eof. llvm-svn: 167238
diff --git a/libcxx/include/istream b/libcxx/include/istream index 72b2004..7b48186 100644 --- a/libcxx/include/istream +++ b/libcxx/include/istream
@@ -1189,7 +1189,11 @@ #endif // _LIBCPP_NO_EXCEPTIONS sentry __sen(*this, true); if (__sen) + { __r = this->rdbuf()->sgetc(); + if (traits_type::eq_int_type(__r, traits_type::eof())) + this->setstate(ios_base::eofbit); + } #ifndef _LIBCPP_NO_EXCEPTIONS } catch (...)