Revert 332508 as it caused problems in the clang test suite.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332555 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Greg Clayton
2018-05-16 23:29:36 +00:00
parent ca6a4d968e
commit 7b227c4398
2 changed files with 2 additions and 7 deletions
-4
View File
@@ -726,10 +726,6 @@ static SmallString<256> remove_dots(StringRef path, bool remove_dot_dot,
SmallString<256> buffer = path::root_path(path, style);
for (StringRef C : components)
path::append(buffer, style, C);
// If the buffer is empty, then return ".". Many other path utilities
// do this so it seems to be an expected result.
if (buffer.empty())
buffer.append(1, '.');
return buffer;
}
+2 -3
View File
@@ -1146,7 +1146,7 @@ static std::string remove_dots(StringRef path, bool remove_dot_dot,
TEST(Support, RemoveDots) {
EXPECT_EQ("foolz\\wat",
remove_dots(".\\.\\\\foolz\\wat", false, path::Style::windows));
EXPECT_EQ(".", remove_dots(".\\\\\\\\\\", false, path::Style::windows));
EXPECT_EQ("", remove_dots(".\\\\\\\\\\", false, path::Style::windows));
EXPECT_EQ("a\\..\\b\\c",
remove_dots(".\\a\\..\\b\\c", false, path::Style::windows));
@@ -1163,8 +1163,7 @@ TEST(Support, RemoveDots) {
EXPECT_EQ("foolz/wat",
remove_dots("././/foolz/wat", false, path::Style::posix));
EXPECT_EQ(".", remove_dots("./////", false, path::Style::posix));
EXPECT_EQ(".", remove_dots("", false, path::Style::posix));
EXPECT_EQ("", remove_dots("./////", false, path::Style::posix));
EXPECT_EQ("a/../b/c", remove_dots("./a/../b/c", false, path::Style::posix));
EXPECT_EQ("b/c", remove_dots("./a/../b/c", true, path::Style::posix));