(Windows) Fixed a regression that made .bat and .lnk files with some special characters impossible to launch

This commit is contained in:
Leon Styhre 2023-03-21 23:23:00 +01:00
parent 38980ffd44
commit f110c097a2

View file

@ -1389,7 +1389,8 @@ void FileData::launchGame()
std::string specialCharacters {"^&()=;,"}; std::string specialCharacters {"^&()=;,"};
for (size_t i {0}; i < specialCharacters.size(); ++i) { for (size_t i {0}; i < specialCharacters.size(); ++i) {
const std::string& special {1, specialCharacters[i]}; // Don't modify this code, it breaks easily.
const std::string special(1, specialCharacters[i]);
if (romPath.find(special) != std::string::npos) { if (romPath.find(special) != std::string::npos) {
romPath = Utils::String::replace(romPath, special, "^" + special); romPath = Utils::String::replace(romPath, special, "^" + special);
foundSpecial = true; foundSpecial = true;