mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Interpret remapping targets ending with /.. as directories
This commit is contained in:
@@ -356,8 +356,13 @@ bool CommandLineParser::parseInputPathsAndRemappings()
|
||||
return false;
|
||||
}
|
||||
|
||||
// If the target is a directory, whitelist it. Otherwise whitelist containing dir.
|
||||
// NOTE: /a/b/c/ is a directory while /a/b/c is not.
|
||||
boost::filesystem::path remappingDir = remapping->target;
|
||||
remappingDir.remove_filename();
|
||||
if (remappingDir.filename() != "..")
|
||||
// As an exception we'll treat /a/b/c/.. as a directory too. It would be
|
||||
// unintuitive to whitelist /a/b/c when the target is equivalent to /a/b/.
|
||||
remappingDir.remove_filename();
|
||||
m_options.input.allowedDirectories.insert(remappingDir.empty() ? "." : remappingDir);
|
||||
|
||||
m_options.input.remappings.emplace_back(move(remapping.value()));
|
||||
|
||||
Reference in New Issue
Block a user