[Boost-bugs] [Boost C++ Libraries] #10766: boost::filesystem::path::parent_path() with redundant separator returns wrong value

Subject: [Boost-bugs] [Boost C++ Libraries] #10766: boost::filesystem::path::parent_path() with redundant separator returns wrong value
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-11-07 07:10:08


#10766: boost::filesystem::path::parent_path() with redundant separator returns
wrong value
---------------------------------------------+------------------------
 Reporter: Kolya Kosenko <kolya.kosenko@…> | Owner: bemandawes
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: filesystem
  Version: Boost 1.57.0 | Severity: Problem
 Keywords: |
---------------------------------------------+------------------------
 boost::filesystem::path::parent_path() function with redundant separator
 at the end of directory don't return parent directory, it just removes
 this separator.

 Ubuntu 12.04, gcc 4.6.3

 Following test fails:
 {{{
 #!patch
 diff --git test/path_unit_test.cpp test/path_unit_test.cpp
 index 67ccb9f..09c7f34 100644
 --- test/path_unit_test.cpp
 +++ test/path_unit_test.cpp
 @@ -662,6 +662,7 @@ namespace
      CHECK(path("/").parent_path().string() == "");
      CHECK(path("/foo").parent_path().string() == "/");
      CHECK(path("/foo/bar").parent_path().string() == "/foo");
 + CHECK(path("/foo/bar/").parent_path().string() == "/foo");

      CHECK(path("/foo/bar/baz.zoo").filename().string() == "baz.zoo");

 }}}

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