Make seeking on an ostream that has eofbit set work correctly. Fixes PR#21361
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@240286 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1004,7 +1004,7 @@ basic_ostream<_CharT, _Traits>&
|
||||
basic_ostream<_CharT, _Traits>::seekp(pos_type __pos)
|
||||
{
|
||||
sentry __s(*this);
|
||||
if (__s)
|
||||
if (!this->fail())
|
||||
{
|
||||
if (this->rdbuf()->pubseekpos(__pos, ios_base::out) == pos_type(-1))
|
||||
this->setstate(ios_base::failbit);
|
||||
@@ -1018,7 +1018,7 @@ basic_ostream<_CharT, _Traits>&
|
||||
basic_ostream<_CharT, _Traits>::seekp(off_type __off, ios_base::seekdir __dir)
|
||||
{
|
||||
sentry __s(*this);
|
||||
if (__s)
|
||||
if (!this->fail())
|
||||
{
|
||||
if (this->rdbuf()->pubseekoff(__off, __dir, ios_base::out) == pos_type(-1))
|
||||
this->setstate(ios_base::failbit);
|
||||
|
Reference in New Issue
Block a user