[clang-tidy] Don't duplicate the leading slash.
authorAlexander Kornienko <alexfh@google.com>
Mon, 27 Jul 2015 13:07:50 +0000 (13:07 +0000)
committerAlexander Kornienko <alexfh@google.com>
Mon, 27 Jul 2015 13:07:50 +0000 (13:07 +0000)
llvm-svn: 243265

clang-tools-extra/clang-tidy/utils/HeaderGuard.cpp

index a981bfb..1d9cc80 100644 (file)
@@ -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;
     }