# HG changeset patch # User Sebastien Jodogne # Date 1762951876 -3600 # Node ID cf8715d1aaf00a0152e5e7eb7fe60c1ecf68cd35 # Parent e0df58ca5fa5c1cca3a96ac559084cfaa595ffe9 using boost::filesystem::path in SystemToolbox::InterpretRelativePath() diff -r e0df58ca5fa5 -r cf8715d1aaf0 OrthancFramework/Sources/SystemToolbox.cpp --- a/OrthancFramework/Sources/SystemToolbox.cpp Wed Nov 12 13:47:56 2025 +0100 +++ b/OrthancFramework/Sources/SystemToolbox.cpp Wed Nov 12 13:51:16 2025 +0100 @@ -1029,27 +1029,25 @@ boost::filesystem::path SystemToolbox::InterpretRelativePath(const boost::filesystem::path& baseDirectory, - const std::string& relativePath) + const boost::filesystem::path& relativePath) { - boost::filesystem::path relative = SystemToolbox::PathFromUtf8(relativePath); - /** The following lines should be equivalent to this one: - return (base / relative); + return (baseDirectory / relativePath); However, for some unknown reason, some versions of Boost do not make the proper path resolution when "baseDirectory" is an absolute path. So, a hack is used below. **/ - if (relative.is_absolute()) + if (relativePath.is_absolute()) { - return relative; + return relativePath; } else { - return baseDirectory / relative; + return baseDirectory / relativePath; } } diff -r e0df58ca5fa5 -r cf8715d1aaf0 OrthancFramework/Sources/SystemToolbox.h --- a/OrthancFramework/Sources/SystemToolbox.h Wed Nov 12 13:47:56 2025 +0100 +++ b/OrthancFramework/Sources/SystemToolbox.h Wed Nov 12 13:51:16 2025 +0100 @@ -136,7 +136,7 @@ static void GetEnvironmentVariables(std::map& env); static boost::filesystem::path InterpretRelativePath(const boost::filesystem::path& baseDirectory, - const std::string& relativePath); + const boost::filesystem::path& relativePath); static void ReadFileRange(std::string& content, const boost::filesystem::path& path,