summaryrefslogtreecommitdiffstats
path: root/Source/CPack/WiX
diff options
context:
space:
mode:
authorRolf Eike Beer <eike@sf-mail.de>2020-03-18 17:59:07 (GMT)
committerRolf Eike Beer <eike@sf-mail.de>2020-03-23 18:47:46 (GMT)
commit871bf0cc88c6b16766c2182574613f6a6a1194fe (patch)
treee83ee024ca9c77238a9d5af0d74370bb8f721a1c /Source/CPack/WiX
parentd6cf89c0d48cc8689a9d6219846b21a210557ed3 (diff)
downloadCMake-871bf0cc88c6b16766c2182574613f6a6a1194fe.zip
CMake-871bf0cc88c6b16766c2182574613f6a6a1194fe.tar.gz
CMake-871bf0cc88c6b16766c2182574613f6a6a1194fe.tar.bz2
CPackWIXGenerator: use cmStrCat for more parts
Diffstat (limited to 'Source/CPack/WiX')
-rw-r--r--Source/CPack/WiX/cmCPackWIXGenerator.cxx10
1 files 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;