diff --git a/include/boost/filesystem/operations.hpp b/include/boost/filesystem/operations.hpp index ef75bde..22e8a5c 100644 --- a/include/boost/filesystem/operations.hpp +++ b/include/boost/filesystem/operations.hpp @@ -654,10 +654,8 @@ namespace boost // TODO: Add error handling inline path relative(const path& p, const path& base) - // [Note: If either p or base is_relative(), user may wish to wrap the call to that - // argument in a call to absolute(). -- end note] { - return semi_canonical(p).relative(semi_canonical(base)); + return semi_canonical(p).relative_to(semi_canonical(base)); } inline diff --git a/include/boost/filesystem/path.hpp b/include/boost/filesystem/path.hpp index 4caaa01..9d7fb9e 100644 --- a/include/boost/filesystem/path.hpp +++ b/include/boost/filesystem/path.hpp @@ -503,7 +503,7 @@ namespace filesystem // ----- lexical operations ----- - path relative(const path& p) const; + path relative_to(const path& p) const; // TODO: document dangers of lack of symlink following, no normalization, // difference of "symlink/.." handling between Windows and POSIX diff --git a/src/path.cpp b/src/path.cpp index 10cbe1c..e180527 100644 --- a/src/path.cpp +++ b/src/path.cpp @@ -405,9 +405,9 @@ namespace filesystem } return std::make_pair(it1, it2); } - } + } // namespace detail - path path::relative(const path& base) const + path path::relative_to(const path& base) const { std::pair mm = detail::mismatch(begin(), end(), base.begin(), base.end());