1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

Add '*' to list of characters banned for save game names

This commit is contained in:
Ivan Savenko 2024-06-04 14:11:22 +00:00
parent 014857b58d
commit 16c7063eb4

View File

@ -244,7 +244,7 @@ void CPlayerInterface::performAutosave()
int txtlen = TextOperations::getUnicodeCharactersCount(name); int txtlen = TextOperations::getUnicodeCharactersCount(name);
TextOperations::trimRightUnicode(name, std::max(0, txtlen - 15)); TextOperations::trimRightUnicode(name, std::max(0, txtlen - 15));
std::string forbiddenChars("\\/:?\"<>| "); std::string forbiddenChars("\\/:*?\"<>| ");
std::replace_if(name.begin(), name.end(), [&](char c) { return std::string::npos != forbiddenChars.find(c); }, '_' ); std::replace_if(name.begin(), name.end(), [&](char c) { return std::string::npos != forbiddenChars.find(c); }, '_' );
prefix = name + "_" + cb->getStartInfo()->startTimeIso8601 + "/"; prefix = name + "_" + cb->getStartInfo()->startTimeIso8601 + "/";