[cfe-commits] [libcxx] r167238 - /libcxx/trunk/include/istream

Howard Hinnant hhinnant at apple.com
Thu Nov 1 10:32:07 PDT 2012


Author: hhinnant
Date: Thu Nov  1 12:32:07 2012
New Revision: 167238

URL: http://llvm.org/viewvc/llvm-project?rev=167238&view=rev
Log:
peek should set eofbit if sgetc() returns eof.

Modified:
    libcxx/trunk/include/istream

Modified: libcxx/trunk/include/istream
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/istream?rev=167238&r1=167237&r2=167238&view=diff
==============================================================================
--- libcxx/trunk/include/istream (original)
+++ libcxx/trunk/include/istream Thu Nov  1 12:32:07 2012
@@ -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 (...)





More information about the cfe-commits mailing list