[clang-tools-extra] r243265 - [clang-tidy] Don't duplicate the leading slash.

Alexander Kornienko alexfh at google.com
Mon Jul 27 06:07:50 PDT 2015


Author: alexfh
Date: Mon Jul 27 08:07:50 2015
New Revision: 243265

URL: http://llvm.org/viewvc/llvm-project?rev=243265&view=rev
Log:
[clang-tidy] Don't duplicate the leading slash.

Modified:
    clang-tools-extra/trunk/clang-tidy/utils/HeaderGuard.cpp

Modified: clang-tools-extra/trunk/clang-tidy/utils/HeaderGuard.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/utils/HeaderGuard.cpp?rev=243265&r1=243264&r2=243265&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/utils/HeaderGuard.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/utils/HeaderGuard.cpp Mon Jul 27 08:07:50 2015
@@ -29,7 +29,7 @@ static std::string cleanPath(StringRef P
       // 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;
     }





More information about the cfe-commits mailing list