Re: [Boost-bugs] [Boost C++ Libraries] #4611: path::operator / does not remove redundant separators

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #4611: path::operator / does not remove redundant separators
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-12-30 23:06:21


#4611: path::operator / does not remove redundant separators
-------------------------------+--------------------------
  Reporter: neo_in_matrix@… | Owner: bemandawes
      Type: Bugs | Status: closed
 Milestone: To Be Determined | Component: filesystem
   Version: Boost 1.44.0 | Severity: Optimization
Resolution: wontfix | Keywords:
-------------------------------+--------------------------
Changes (by bemandawes):

 * status: new => closed
 * resolution: => wontfix

Comment:

 See http://cplusplus.github.io/filesystem-ts/working-draft.html#path-
 appends

 The ISO C++ filesystem TS says:

  Appends `path::preferred_separator` to `pathname` unless:

  * an added separator would be redundant, or
  * would change a relative path to an absolute path [Note: An empty path
 is relative. — end note], or
  * `p.empty()`, or
  * `*p.native().cbegin()` is a directory separator.


  Then appends `p.native()` to `pathname`.

 Boost.Filesystem follows the TS here. The TS does not add a separator if
 it would be redundant, but if native() ends with a separator and the
 append argument begins with a separator, both are retained.

 You are free to report this to the C++ committee as defect, and if they
 decide to change the spec then Boost.Filesystem will follow their lead.
 But I'm not aware of any reason for adding a gratuitous difference between
 Boost and other implementation.

 Thanks for your interest in Boost.Filesystem,

 --Beman

 PS: Test case added to verify the library works as expected per your test
 case.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4611#comment:3>
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:17 UTC