diff options
author | Greg Clayton <gclayton@apple.com> | 2018-05-16 23:29:36 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2018-05-16 23:29:36 +0000 |
commit | f81f3a838a1de436e103a422808f575d803d8ace (patch) | |
tree | 2dc4dc5f6ff305fd0fb5bcf9af9881576dccecfa /llvm | |
parent | e9c6f06cce2c69e91c7dcffbef3bcacb05bdea71 (diff) | |
download | bcm5719-llvm-f81f3a838a1de436e103a422808f575d803d8ace.tar.gz bcm5719-llvm-f81f3a838a1de436e103a422808f575d803d8ace.zip |
Revert 332508 as it caused problems in the clang test suite.
llvm-svn: 332555
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/lib/Support/Path.cpp | 4 | ||||
-rw-r--r-- | llvm/unittests/Support/Path.cpp | 5 |
2 files changed, 2 insertions, 7 deletions
diff --git a/llvm/lib/Support/Path.cpp b/llvm/lib/Support/Path.cpp index dfe9f470bab..ff41dd47c42 100644 --- a/llvm/lib/Support/Path.cpp +++ b/llvm/lib/Support/Path.cpp @@ -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; } diff --git a/llvm/unittests/Support/Path.cpp b/llvm/unittests/Support/Path.cpp index 1efa7715cac..e91f760f99f 100644 --- a/llvm/unittests/Support/Path.cpp +++ b/llvm/unittests/Support/Path.cpp @@ -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)); |