[Boost-bugs] [Boost C++ Libraries] #7681: Bug in indirect_streambuf::seek_impl

Subject: [Boost-bugs] [Boost C++ Libraries] #7681: Bug in indirect_streambuf::seek_impl
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-11-12 12:10:29


#7681: Bug in indirect_streambuf::seek_impl
----------------------------------+-----------------------------------------
 Reporter: lodos@… | Owner: turkanis
     Type: Bugs | Status: new
Milestone: Boost 1.53.0 | Component: iostreams
  Version: Boost 1.52.0 | Severity: Problem
 Keywords: |
----------------------------------+-----------------------------------------
 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);
 }

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7681>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:11 UTC