diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-10-06 21:23:22 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-06 21:23:22 +0800 |
commit | 6c09e32c3fff143bd71d82d54d8599bee231222a (patch) | |
tree | fdf477b7405dec9d83a620834d861da906a37012 | |
parent | 094012dbb046655ac0291f6c4632f306406c0ada (diff) | |
parent | a458100175fa2b6d265ec939ae12b95ee89acb13 (diff) | |
download | dexon-solidity-6c09e32c3fff143bd71d82d54d8599bee231222a.tar dexon-solidity-6c09e32c3fff143bd71d82d54d8599bee231222a.tar.gz dexon-solidity-6c09e32c3fff143bd71d82d54d8599bee231222a.tar.bz2 dexon-solidity-6c09e32c3fff143bd71d82d54d8599bee231222a.tar.lz dexon-solidity-6c09e32c3fff143bd71d82d54d8599bee231222a.tar.xz dexon-solidity-6c09e32c3fff143bd71d82d54d8599bee231222a.tar.zst dexon-solidity-6c09e32c3fff143bd71d82d54d8599bee231222a.zip |
Merge pull request #3015 from Getline-Network/develop
Allow trailing slash in solc -allow-paths.
-rw-r--r-- | solc/CommandLineInterface.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/solc/CommandLineInterface.cpp b/solc/CommandLineInterface.cpp index 271511d4..1686dc2e 100644 --- a/solc/CommandLineInterface.cpp +++ b/solc/CommandLineInterface.cpp @@ -716,8 +716,17 @@ bool CommandLineInterface::processInput() if (m_args.count(g_argAllowPaths)) { vector<string> paths; - for (string const& path: boost::split(paths, m_args[g_argAllowPaths].as<string>(), boost::is_any_of(","))) - m_allowedDirectories.push_back(boost::filesystem::path(path)); + for (string const& path: boost::split(paths, m_args[g_argAllowPaths].as<string>(), boost::is_any_of(","))) { + auto filesystem_path = boost::filesystem::path(path); + // If the given path had a trailing slash, the Boost filesystem + // path will have it's last component set to '.'. This breaks + // path comparison in later parts of the code, so we need to strip + // it. + if (filesystem_path.filename() == ".") { + filesystem_path.remove_filename(); + } + m_allowedDirectories.push_back(filesystem_path); + } } if (m_args.count(g_argStandardJSON)) |