Opened 10 years ago
#7681 new Bugs
Bug in indirect_streambuf::seek_impl
Reported by: | Owned by: | Jonathan Turkanis | |
---|---|---|---|
Milestone: | Boost 1.53.0 | Component: | iostreams |
Version: | Boost 1.52.0 | Severity: | Problem |
Keywords: | Cc: |
Description
Currently indirect_streambuf::seek_impl always modifies input and output pointers with code:
setg(0, 0, 0); setp(0, 0);
See detail/indirect_streambuf.hpp. However, this is incorrect for dual seekable streams buffers which only modifies one set of pointers on each seek (in or out). As a consequence, dual seekable devices cannot be correctly seek. Those 2 lines should be replaced by:
if (is_convertible<category, dual_seekable>::value) {
if (which == BOOST_IOS::in) {
setg(0, 0, 0);
} if (which == BOOST_IOS::out) {
setp(0, 0);
}
} else {
setg(0, 0, 0); setp(0, 0);
}
Note:
See TracTickets
for help on using tickets.