From 07ca38732624412b02b8a311b0231a33e4910391 Mon Sep 17 00:00:00 2001 From: Eberhard Graether Date: Tue, 24 Mar 2015 23:57:43 +0100 Subject: [PATCH] utility: fixed sorting of FilePaths in STL containers --- src/lib/utility/file/FilePath.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib/utility/file/FilePath.cpp b/src/lib/utility/file/FilePath.cpp index fccb5c01..1cfc9354 100644 --- a/src/lib/utility/file/FilePath.cpp +++ b/src/lib/utility/file/FilePath.cpp @@ -75,5 +75,10 @@ bool FilePath::operator!=(const FilePath& other) const bool FilePath::operator<(const FilePath& other) const { + if (exists() && other.exists()) + { + return boost::filesystem::canonical(m_path).compare(boost::filesystem::canonical(other.m_path)) < 0; + } + return boost::filesystem::absolute(m_path).compare(boost::filesystem::absolute(other.m_path)) < 0; }