From 4840eb5d2b3d20664565872adea835d5c70c1c4c Mon Sep 17 00:00:00 2001 From: LLVM Packaging Team Date: Wed, 2 Sep 2020 12:55:46 +0100 Subject: [PATCH] remove-trailing-space-version =================================================================== Gbp-Pq: Name remove-trailing-space-version.diff --- clang/lib/Basic/Version.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/clang/lib/Basic/Version.cpp b/clang/lib/Basic/Version.cpp index e1b9ccf2e..e05a57e97 100644 --- a/clang/lib/Basic/Version.cpp +++ b/clang/lib/Basic/Version.cpp @@ -125,8 +125,12 @@ std::string getClangToolFullVersion(StringRef ToolName) { #ifdef CLANG_VENDOR OS << CLANG_VENDOR; #endif - OS << ToolName << " version " CLANG_VERSION_STRING "-" DEB_PATCHSETVERSION " " - << getClangFullRepositoryVersion(); + OS << ToolName << " version " CLANG_VERSION_STRING "-" DEB_PATCHSETVERSION; + + std::string repo = getClangFullRepositoryVersion(); + if (!repo.empty()) { + OS << " " << repo; + } return OS.str(); } @@ -139,7 +143,13 @@ std::string getClangFullCPPVersion() { #ifdef CLANG_VENDOR OS << CLANG_VENDOR; #endif - OS << "Clang " CLANG_VERSION_STRING " " << getClangFullRepositoryVersion(); + OS << "Clang " CLANG_VERSION_STRING; + + std::string repo = getClangFullRepositoryVersion(); + if (!repo.empty()) { + OS << " " << repo; + } + return OS.str(); } -- 2.30.2