[PATCH] D88507: [clangd][remote] Make sure relative paths are absolute with respect to posix style

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 29 11:16:35 PDT 2020


kadircet created this revision.
kadircet added a reviewer: kbobyrev.
Herald added subscribers: cfe-commits, usaxena95, arphaman.
Herald added a project: clang.
kadircet requested review of this revision.
Herald added subscribers: MaskRay, ilya-biryukov.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D88507

Files:
  clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp


Index: clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp
===================================================================
--- clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp
+++ clang-tools-extra/clangd/index/remote/marshalling/Marshalling.cpp
@@ -299,7 +299,7 @@
   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);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88507.295063.patch
Type: text/x-patch
Size: 773 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200929/1a0cf438/attachment.bin>


More information about the cfe-commits mailing list