diff options
-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) { |