From ae8f23efa862c8d3321319a96c773cf7e47c0de5 Mon Sep 17 00:00:00 2001 From: Alexander Kornienko Date: Mon, 27 Jul 2015 13:07:50 +0000 Subject: [PATCH] [clang-tidy] Don't duplicate the leading slash. llvm-svn: 243265 --- clang-tools-extra/clang-tidy/utils/HeaderGuard.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang-tools-extra/clang-tidy/utils/HeaderGuard.cpp b/clang-tools-extra/clang-tidy/utils/HeaderGuard.cpp index a981bfb..1d9cc80 100644 --- a/clang-tools-extra/clang-tidy/utils/HeaderGuard.cpp +++ b/clang-tools-extra/clang-tidy/utils/HeaderGuard.cpp @@ -29,7 +29,7 @@ static std::string cleanPath(StringRef Path) { // Drop the last component. NewPath.resize(llvm::sys::path::parent_path(NewPath).size()); } else { - if (!NewPath.empty()) + if (!NewPath.empty() && !NewPath.endswith("/")) NewPath += '/'; NewPath += *I; } -- 2.7.4