Skip to content

Commit

Permalink
[clangd][remote] Make sure relative paths are absolute with respect t…
Browse files Browse the repository at this point in the history
…o 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
  • Loading branch information
kadircet committed Sep 30, 2020
1 parent d99f46c commit 64e8fd5
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -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);
Expand Down

0 comments on commit 64e8fd5

Please sign in to comment.