File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -310,7 +310,7 @@ llvm::Optional<FileSpec::Style> FileSpec::GuessPathStyle(llvm::StringRef absolut
310
310
return Style::posix;
311
311
if (absolute_path.startswith (R"( \\)" ))
312
312
return Style::windows;
313
- if (absolute_path.size () > 3 && llvm::isAlpha (absolute_path[0 ]) &&
313
+ if (absolute_path.size () >= 3 && llvm::isAlpha (absolute_path[0 ]) &&
314
314
absolute_path.substr (1 , 2 ) == R"( :\)" )
315
315
return Style::windows;
316
316
return llvm::None;
Original file line number Diff line number Diff line change @@ -198,8 +198,10 @@ TEST(FileSpecTest, GuessPathStyle) {
198
198
FileSpec::GuessPathStyle (R"( C:\foo.txt)" ));
199
199
EXPECT_EQ (FileSpec::Style::windows,
200
200
FileSpec::GuessPathStyle (R"( \\net\foo.txt)" ));
201
+ EXPECT_EQ (FileSpec::Style::windows, FileSpec::GuessPathStyle (R"( Z:\)" ));
201
202
EXPECT_EQ (llvm::None, FileSpec::GuessPathStyle (" foo.txt" ));
202
203
EXPECT_EQ (llvm::None, FileSpec::GuessPathStyle (" foo/bar.txt" ));
204
+ EXPECT_EQ (llvm::None, FileSpec::GuessPathStyle (" Z:" ));
203
205
}
204
206
205
207
TEST (FileSpecTest, GetPath) {
You can’t perform that action at this time.
0 commit comments