From 871bf0cc88c6b16766c2182574613f6a6a1194fe Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Wed, 18 Mar 2020 18:59:07 +0100 Subject: CPackWIXGenerator: use cmStrCat for more parts --- Source/CPack/WiX/cmCPackWIXGenerator.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx index 67d3d32..2ce989c 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx +++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx @@ -1099,14 +1099,14 @@ std::string cmCPackWIXGenerator::CreateHashedId( cmCryptoHash sha1(cmCryptoHash::AlgoSHA1); std::string const hash = sha1.HashString(path); - std::string identifier = cmStrCat(cm::string_view(hash).substr(0, 7), '_'); - const size_t maxFileNameLength = 52; + std::string identifier = + cmStrCat(cm::string_view(hash).substr(0, 7), '_', + cm::string_view(normalizedFilename).substr(0, maxFileNameLength)); + + // if the name was truncated if (normalizedFilename.length() > maxFileNameLength) { - identifier += normalizedFilename.substr(0, maxFileNameLength - 3); identifier += "..."; - } else { - identifier += normalizedFilename; } return identifier; -- cgit v0.12