From: Kadir Cetinkaya Date: Tue, 29 Sep 2020 18:15:03 +0000 (+0200) Subject: [clangd][remote] Make sure relative paths are absolute with respect to posix style X-Git-Tag: llvmorg-13-init~10539 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=64e8fd540ecc38ee3daf942499091589785e2733;p=platform%2Fupstream%2Fllvm.git [clangd][remote] Make sure relative paths are absolute with respect to posix style Relative paths received from the server are always in posix style. So we need to ensure they are relative using that style, and not the native one. Differential Revision: https://reviews.llvm.org/D88507 --- diff --git a/clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp b/clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp index 31ce4a4..d61848f 100644 --- a/clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp +++ b/clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp @@ -299,7 +299,7 @@ Marshaller::relativePathToURI(llvm::StringRef RelativePath) { assert(RelativePath == llvm::sys::path::convert_to_slash(RelativePath)); if (RelativePath.empty()) return error("Empty relative path."); - if (llvm::sys::path::is_absolute(RelativePath)) + if (llvm::sys::path::is_absolute(RelativePath, llvm::sys::path::Style::posix)) return error("RelativePath '{0}' is absolute.", RelativePath); llvm::SmallString<256> FullPath = llvm::StringRef(*LocalIndexRoot); llvm::sys::path::append(FullPath, RelativePath);