feat(exe): fixing processes with space in their name

This commit is contained in:
PancakeTAS 2025-08-11 14:11:43 +02:00 committed by Pancake
parent e09d590f2d
commit 60baec1e26

View file

@ -251,11 +251,15 @@ std::pair<std::string, std::string> Utils::getProcessName() {
if (!line.ends_with(".exe"))
continue;
const size_t pos = line.find_last_of(' ');
if (pos == std::string::npos)
continue;
size_t pos = line.find_first_of('/');
if (pos == std::string::npos) {
pos = line.find_last_of(' ');
if (pos == std::string::npos)
continue;
pos += 1; // skip space
}
const std::string exe_name = line.substr(pos + 1);
const std::string exe_name = line.substr(pos);
if (exe_name.empty())
continue;