[Boost-bugs] [Boost C++ Libraries] #5989: path iterator appends / instead of \ on windows

Subject: [Boost-bugs] [Boost C++ Libraries] #5989: path iterator appends / instead of \ on windows
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-10-07 06:42:00


#5989: path iterator appends / instead of \ on windows
---------------------------------------------+------------------------------
 Reporter: Sachin Garg <schngrg@…> | Owner: bemandawes
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: filesystem
  Version: Boost 1.47.0 | Severity: Problem
 Keywords: |
---------------------------------------------+------------------------------
 In boost v1.47, filesystem\v\src\path.cpp, inside function
 m_path_iterator_increment, on line line 654,

 It should be:
   it.m_element.m_pathname = preferred_separator;

 Instead of
   it.m_element.m_pathname = separator;

 Reason:
 In below sample code

   boost::filesystem::path new_path;
   for (fs::path::iterator i=path.begin();i!=path.end();i++) {
     new_path/=(*i);

 On windows when iterating a path using above code, line 654 incorrectly
 appends / instead of \ after drive letter.

 For example,
   D:\path\file
 Becomes,
   D:/path\file

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5989>
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:07 UTC