From e17c42b2efac2d420c3cbcf9aea06f3e2201e46c Mon Sep 17 00:00:00 2001 From: malte_langkabel Date: Mon, 25 Apr 2016 16:45:29 +0200 Subject: [PATCH] ui: fixed show files in project settings * FilePath::relativeTo(...) did not return correct results for non-canonical paths (for a base path containing "/foo/.." it would prepend "../" two times instead of omitting it). --- src/lib/utility/file/FilePath.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/utility/file/FilePath.cpp b/src/lib/utility/file/FilePath.cpp index cb2107f8..98044eb9 100644 --- a/src/lib/utility/file/FilePath.cpp +++ b/src/lib/utility/file/FilePath.cpp @@ -131,8 +131,9 @@ FilePath FilePath::expandEnvironmentVariables() const FilePath FilePath::relativeTo(const FilePath& other) const { - boost::filesystem::path a = m_path; - boost::filesystem::path b = other.m_path; + + boost::filesystem::path a = this->canonical().m_path; + boost::filesystem::path b = other.canonical().m_path; if (a.root_path() != b.root_path()) {