Skip to content

Commit 27f01c8

Browse files
committed
Revert "[libcxx] Fix xsgetn in basic_filebuf (#167779)"
This reverts commit ea16f7d.
1 parent bb0a95d commit 27f01c8

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

libcxx/include/fstream

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -315,14 +315,8 @@ protected:
315315
traits_type::copy(__str, this->gptr(), __n);
316316
this->__gbump_ptrdiff(__n);
317317
}
318-
const streamsize __remainder = __len - __n;
319-
const streamsize __buffer_space = this->egptr() - this->eback();
320-
321-
if (__remainder >= __buffer_space)
322-
return std::fread(__str + __n, sizeof(char_type), __remainder, __file_) + __n;
323-
else if (__remainder > 0)
324-
return basic_streambuf<_CharT, _Traits>::xsgetn(__str + __n, __remainder) + __n;
325-
return __n;
318+
if (__len - __n >= this->egptr() - this->eback())
319+
return std::fread(__str + __n, sizeof(char_type), __len - __n, __file_);
326320
}
327321
return basic_streambuf<_CharT, _Traits>::xsgetn(__str, __len);
328322
}

0 commit comments

Comments
 (0)