[Boost-bugs] [Boost C++ Libraries] #13642: Strange behaviour of filesystem::relative on Windows

Subject: [Boost-bugs] [Boost C++ Libraries] #13642: Strange behaviour of filesystem::relative on Windows
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2018-07-25 12:21:31


#13642: Strange behaviour of filesystem::relative on Windows
------------------------------+-------------------------
 Reporter: martin.apel@… | Owner: Beman Dawes
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: filesystem
  Version: Boost 1.67.0 | Severity: Problem
 Keywords: windows relative |
------------------------------+-------------------------
 The following code snippet behaves unexpected under Windows:

 {{{
    path base("C:\\Temp");
    path contained ("c:\\temp\\test");

    path result = relative(contained, base);

    std::cout << "relative returns " << result.generic_string() << "\n";
 }}}

 It returns an empty path, though the expected result would be something
 like ".\test". This is due to a case sensitive comparison, which is not
 consistent with how Windows treats path names.

 I understand that this is the way it is documented, but if
 Boost.Filesystem is understood to be an abstraction layer over different
 operating systems, this is definitely not the desired behaviour.

 I have attached a patch, which fixes the problem.

-- 
Ticket URL: <https://svn.boost.org/trac10/ticket/13642>
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 : 2018-07-25 12:27:10 UTC