mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Remove boost::filesystem::weakly_canonical workaround
This commit is contained in:
parent
127c78ee64
commit
8c97fb1688
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user