Mercurial > hg > orthanc
comparison Core/SystemToolbox.cpp @ 2938:d658f5785b7b
merge
author | am@osimis.io |
---|---|
date | Wed, 28 Nov 2018 14:37:17 +0100 |
parents | 4a38d7d4f0e0 |
children | d924f9bb61cc |
comparison
equal
deleted
inserted
replaced
2937:1ab59dfd4afc | 2938:d658f5785b7b |
---|---|
708 std::string value = v.substr(pos + 1); | 708 std::string value = v.substr(pos + 1); |
709 env[key] = value; | 709 env[key] = value; |
710 } | 710 } |
711 } | 711 } |
712 } | 712 } |
713 | |
714 | |
715 std::string SystemToolbox::InterpretRelativePath(const std::string& baseDirectory, | |
716 const std::string& relativePath) | |
717 { | |
718 boost::filesystem::path base(baseDirectory); | |
719 boost::filesystem::path relative(relativePath); | |
720 | |
721 /** | |
722 The following lines should be equivalent to this one: | |
723 | |
724 return (base / relative).string(); | |
725 | |
726 However, for some unknown reason, some versions of Boost do not | |
727 make the proper path resolution when "baseDirectory" is an | |
728 absolute path. So, a hack is used below. | |
729 **/ | |
730 | |
731 if (relative.is_absolute()) | |
732 { | |
733 return relative.string(); | |
734 } | |
735 else | |
736 { | |
737 return (base / relative).string(); | |
738 } | |
739 } | |
713 } | 740 } |