check only for partial path

This commit is contained in:
PancakeTAS 2025-07-17 23:05:42 +02:00 committed by Pancake
parent bb976ea863
commit f62e658b11
2 changed files with 5 additions and 2 deletions

View file

@ -13,6 +13,7 @@
#include <unordered_map>
#include <string_view>
#include <filesystem>
#include <algorithm>
#include <exception>
#include <stdexcept>
#include <iostream>
@ -207,7 +208,9 @@ Configuration Config::getConfig(std::string_view name) {
return globalConf;
const auto& games = *gameConfs;
auto it = games.find(std::string(name));
auto it = std::ranges::find_if(games, [&name](const auto& pair) {
return name.ends_with(pair.first);
});
if (it != games.end())
return it->second;

View file

@ -217,7 +217,7 @@ std::string Utils::getProcessName() {
if (exe_len <= 0)
return "Unknown Process";
exe.at(static_cast<size_t>(exe_len)) = '\0';
return{basename(exe.data())};
return{exe.data()};
}
/// Get the config file