[Lldb-commits] [PATCH] D115104: [lldb] Fix guessing of windows path style
Jaroslav Sevcik via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue Dec 7 02:23:43 PST 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rGf72ae5cba1d6: [lldb] Fix windows path guessing for root paths (authored by jarin).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D115104/new/
https://reviews.llvm.org/D115104
Files:
lldb/source/Utility/FileSpec.cpp
lldb/unittests/Utility/FileSpecTest.cpp
Index: lldb/unittests/Utility/FileSpecTest.cpp
===================================================================
--- lldb/unittests/Utility/FileSpecTest.cpp
+++ lldb/unittests/Utility/FileSpecTest.cpp
@@ -198,8 +198,10 @@
FileSpec::GuessPathStyle(R"(C:\foo.txt)"));
EXPECT_EQ(FileSpec::Style::windows,
FileSpec::GuessPathStyle(R"(\\net\foo.txt)"));
+ EXPECT_EQ(FileSpec::Style::windows, FileSpec::GuessPathStyle(R"(Z:\)"));
EXPECT_EQ(llvm::None, FileSpec::GuessPathStyle("foo.txt"));
EXPECT_EQ(llvm::None, FileSpec::GuessPathStyle("foo/bar.txt"));
+ EXPECT_EQ(llvm::None, FileSpec::GuessPathStyle("Z:"));
}
TEST(FileSpecTest, GetPath) {
Index: lldb/source/Utility/FileSpec.cpp
===================================================================
--- lldb/source/Utility/FileSpec.cpp
+++ lldb/source/Utility/FileSpec.cpp
@@ -310,7 +310,7 @@
return Style::posix;
if (absolute_path.startswith(R"(\\)"))
return Style::windows;
- if (absolute_path.size() > 3 && llvm::isAlpha(absolute_path[0]) &&
+ if (absolute_path.size() >= 3 && llvm::isAlpha(absolute_path[0]) &&
absolute_path.substr(1, 2) == R"(:\)")
return Style::windows;
return llvm::None;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115104.392316.patch
Type: text/x-patch
Size: 1215 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20211207/c55717ac/attachment.bin>
More information about the lldb-commits
mailing list