diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2019-01-19 01:59:32 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2019-01-19 01:59:32 +0800 |
commit | 8c97fb1688f7d756c783c65504f400c7f5f5f7e5 (patch) | |
tree | 1e8e2189e11d3dbbbd3163ca2ee061e963bd112f | |
parent | 127c78ee64f3ad2c301d6805d96cb153df3eeeee (diff) | |
download | dexon-solidity-8c97fb1688f7d756c783c65504f400c7f5f5f7e5.tar.gz dexon-solidity-8c97fb1688f7d756c783c65504f400c7f5f5f7e5.tar.zst dexon-solidity-8c97fb1688f7d756c783c65504f400c7f5f5f7e5.zip |
Remove boost::filesystem::weakly_canonical workaround
-rw-r--r-- | libdevcore/CommonIO.cpp | 20 | ||||
-rw-r--r-- | libdevcore/CommonIO.h | 4 | ||||
-rw-r--r-- | solc/CommandLineInterface.cpp | 2 |
3 files changed, 1 insertions, 25 deletions
diff --git a/libdevcore/CommonIO.cpp b/libdevcore/CommonIO.cpp index cc730575..29b31ebc 100644 --- a/libdevcore/CommonIO.cpp +++ b/libdevcore/CommonIO.cpp @@ -128,26 +128,6 @@ int dev::readStandardInputChar() return cin.get(); } -boost::filesystem::path dev::weaklyCanonicalFilesystemPath(boost::filesystem::path const &_path) -{ - if (boost::filesystem::exists(_path)) - return boost::filesystem::canonical(_path); - else - { - boost::filesystem::path head(_path); - boost::filesystem::path tail; - for (auto it = --_path.end(); !head.empty(); --it) - { - if (boost::filesystem::exists(head)) - break; - tail = (*it) / tail; - head.remove_filename(); - } - head = boost::filesystem::canonical(head); - return head / tail; - } -} - string dev::absolutePath(string const& _path, string const& _reference) { boost::filesystem::path p(_path); diff --git a/libdevcore/CommonIO.h b/libdevcore/CommonIO.h index b9f941ea..0d8aca79 100644 --- a/libdevcore/CommonIO.h +++ b/libdevcore/CommonIO.h @@ -50,10 +50,6 @@ std::string toString(_T const& _t) return o.str(); } -/// Partial implementation of boost::filesystem::weakly_canonical (available in boost>=1.60). -/// Should be replaced by the boost implementation as soon as support for boost<1.60 can be dropped. -boost::filesystem::path weaklyCanonicalFilesystemPath(boost::filesystem::path const &_path); - /// @returns the absolute path corresponding to @a _path relative to @a _reference. std::string absolutePath(std::string const& _path, std::string const& _reference); diff --git a/solc/CommandLineInterface.cpp b/solc/CommandLineInterface.cpp index bda1b78a..4bf24901 100644 --- a/solc/CommandLineInterface.cpp +++ b/solc/CommandLineInterface.cpp @@ -731,7 +731,7 @@ bool CommandLineInterface::processInput() try { auto path = boost::filesystem::path(_path); - auto canonicalPath = weaklyCanonicalFilesystemPath(path); + auto canonicalPath = boost::filesystem::weakly_canonical(path); bool isAllowed = false; for (auto const& allowedDir: m_allowedDirectories) { |