From 35ab2a11bb55c39ef9fe389aeacc14bb55c5a12d Mon Sep 17 00:00:00 2001 From: Paul Pluzhnikov Date: Thu, 2 Jun 2022 10:30:24 -0700 Subject: Fix a buglet in remove_dots(). The function promises to canonicalize the path, but neglected to do so for the root component. For example, calling remove_dots("/tmp/foo.c", Style::windows_backslash) resulted in "/tmp\foo.c". Now it produces "\tmp\foo.c". Also fix FIXME in the corresponding test. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D126412 --- clang/unittests/Basic/FileManagerTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/unittests/Basic/FileManagerTest.cpp') diff --git a/clang/unittests/Basic/FileManagerTest.cpp b/clang/unittests/Basic/FileManagerTest.cpp index b8b12a9..535d4d9 100644 --- a/clang/unittests/Basic/FileManagerTest.cpp +++ b/clang/unittests/Basic/FileManagerTest.cpp @@ -411,7 +411,7 @@ TEST_F(FileManagerTest, getVirtualFileWithDifferentName) { #endif // !_WIN32 static StringRef getSystemRoot() { - return is_style_windows(llvm::sys::path::Style::native) ? "C:/" : "/"; + return is_style_windows(llvm::sys::path::Style::native) ? "C:\\" : "/"; } TEST_F(FileManagerTest, makeAbsoluteUsesVFS) { -- cgit v1.1