(Windows) Made the hack to remove double quotation marks on game launch slightly less dangerous

This commit is contained in:
Leon Styhre 2025-03-16 17:35:19 +01:00
parent 4dc5275303
commit 26472bccbc

View file

@ -1944,6 +1944,9 @@ void FileData::launchGame()
#if defined(_WIN64) #if defined(_WIN64)
// Hack to remove double quotation marks as these can occur under some special circumstances. // Hack to remove double quotation marks as these can occur under some special circumstances.
const int quotationCount {static_cast<int>(
std::count_if(command.cbegin(), command.cend(), [](char c) { return c == '\"'; }))};
if (quotationCount % 2 != 0)
command = Utils::String::replace(command, "\"\"", "\""); command = Utils::String::replace(command, "\"\"", "\"");
command = Utils::String::replace( command = Utils::String::replace(