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; } _______________________________________________ cfe-commits mailing list cfe-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits