Re: [Boost-bugs] [Boost C++ Libraries] #5529: Problem with boost::filesystem::path

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #5529: Problem with boost::filesystem::path
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-05-25 02:22:03


#5529: Problem with boost::filesystem::path
----------------------------------------------------+-----------------------
  Reporter: Leo Carreon <lcarreon@…> | Owner: bemandawes
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: filesystem
   Version: Boost 1.46.1 | Severity: Problem
Resolution: | Keywords:
----------------------------------------------------+-----------------------

Comment (by Leo Carreon <lcarreon@…>):

 Hi,

 What I meant in my original description of the problem above is that in
 Boost 1.46.1 the function path::make_preferred() is converting backslashes
 to slashes on a Windows environment which is contrary to what the
 documentation says.

 I have looked in the Boost 1.46.1 source code and that is exactly what the
 code is doing, i.e. replacing backslashes with slashes using a
 std::replace() call. This new version of path::make_preferred() is now
 called by path::generic_string() and path::generic_wstring().

 Whereas in Boost 1.45.0, path::make_preferred() converts slashes to
 backslashes and a private function path::m_portable() converts backslashes
 to slashes with both functions using a for loop to make the replacements.
 In this version, path::generic_string() and path::generic_wstring() call
 path::m_portable().

 In my opinion, the 1.45.0 code is correct and could be improved by
 replacing the for loops with the std::replace() calls. A better name for
 path::m_portable() could be path::make_generic().

 I have also checked the code in Boost 1.46.0, in this version
 path::make_preferred() is identical to that in Boost 1.45.0 thus the
 undocumented change is actually between Boost 1.46.0 and Boost 1.46.1.

 I hope my explanation above clarifies this matter.

 Regards,

 Leo

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5529#comment:2>
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:06 UTC