Skip to content

Commit

Permalink
Allow trailing slash in solc -allow-paths.
Browse files Browse the repository at this point in the history
This fixes ethereum#2147 .
  • Loading branch information
q3k committed Oct 3, 2017
1 parent cfc4e5d commit 235844e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions solc/CommandLineInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 235844e

Please sign in to comment.