fix sys::path::remove_dots(path, /*remove_dot_dot=*/true);

This commit is contained in:
Abbyyan 2020-07-13 14:13:03 +08:00
parent 98dd9fd434
commit 56fb3c30c5

View File

@ -6,6 +6,7 @@
#include "config.hh"
#include "platform.hh"
#include <filesystem>
#include <clang/AST/Type.h>
#include <clang/Driver/Action.h>
#include <clang/Driver/Compilation.h>
@ -33,6 +34,7 @@ std::string pathFromFileEntry(const FileEntry &file) {
std::string ret(path.str());
if (checkFolder(ret))
return ret;
ret = std::filesystem::exists(ret)? ret: file.tryGetRealPathName().str();
// Resolve symlinks outside of workspace folders, e.g. /usr/include/c++/7.3.0
return normalizeFolder(ret) ? ret : realPath(ret);
}