aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/interface/CompilerStack.cpp
diff options
context:
space:
mode:
authorYoichi Hirai <i@yoichihirai.com>2017-01-02 23:47:45 +0800
committerYoichi Hirai <i@yoichihirai.com>2017-01-04 01:18:22 +0800
commit41fe412389645fd423c8fb2422db99892f829030 (patch)
treed4330c80a58822c5f222b5e32b7f5c55c2ba2b20 /libsolidity/interface/CompilerStack.cpp
parent9128e73b03856c72e90c581cb36e931e971af29e (diff)
downloaddexon-solidity-41fe412389645fd423c8fb2422db99892f829030.tar.gz
dexon-solidity-41fe412389645fd423c8fb2422db99892f829030.tar.zst
dexon-solidity-41fe412389645fd423c8fb2422db99892f829030.zip
interface: change absolutePath() so that ".dir" is considered as an absolute path
fixes #1534
Diffstat (limited to 'libsolidity/interface/CompilerStack.cpp')
-rw-r--r--libsolidity/interface/CompilerStack.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp
index 4095844f..ee55f41a 100644
--- a/libsolidity/interface/CompilerStack.cpp
+++ b/libsolidity/interface/CompilerStack.cpp
@@ -593,11 +593,11 @@ bool CompilerStack::checkLibraryNameClashes()
string CompilerStack::absolutePath(string const& _path, string const& _reference) const
{
- // Anything that does not start with `.` is an absolute path.
- if (_path.empty() || _path.front() != '.')
- return _path;
using path = boost::filesystem::path;
path p(_path);
+ // Anything that does not start with `.` is an absolute path.
+ if (p.begin() == p.end() || (*p.begin() != "." && *p.begin() != ".."))
+ return _path;
path result(_reference);
result.remove_filename();
for (path::iterator it = p.begin(); it != p.end(); ++it)