interface: change absolutePath() so that ".dir" is considered as an absolute path

fixes #1534
This commit is contained in:
Yoichi Hirai 2017-01-02 16:47:45 +01:00
parent 9128e73b03
commit 41fe412389
No known key found for this signature in database
GPG Key ID: E7B75D080FCF7992

View File

@ -593,11 +593,11 @@ bool CompilerStack::checkLibraryNameClashes()
string CompilerStack::absolutePath(string const& _path, string const& _reference) const 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; using path = boost::filesystem::path;
path p(_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); path result(_reference);
result.remove_filename(); result.remove_filename();
for (path::iterator it = p.begin(); it != p.end(); ++it) for (path::iterator it = p.begin(); it != p.end(); ++it)