aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-10-06 21:23:22 +0800
committerGitHub <noreply@github.com>2017-10-06 21:23:22 +0800
commit6c09e32c3fff143bd71d82d54d8599bee231222a (patch)
treefdf477b7405dec9d83a620834d861da906a37012
parent094012dbb046655ac0291f6c4632f306406c0ada (diff)
parenta458100175fa2b6d265ec939ae12b95ee89acb13 (diff)
downloaddexon-solidity-6c09e32c3fff143bd71d82d54d8599bee231222a.tar.gz
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.cpp13
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))