fix #869
This commit is contained in:
parhelia512 2025-10-29 00:28:25 +08:00 committed by GitHub
commit 45ce180932
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -785,17 +785,18 @@ namespace Configs {
bool RoutingChain::add_simple_process_rule(const QString& content, const std::shared_ptr<RouteRule>& rule, ruleType type)
{
auto sp = content.split(":");
if (sp.size() != 2) return false;
const QString& address = sp[1];
if (sp.size() < 2) return false;
const QString& subType = sp[0];
if (subType == "processName" && type == simpleProcessName)
{
if (!rule->process_name.contains(address)) rule->process_name.append(address);
return true;
} else if (subType == "processPath" && type == simpleProcessPath)
if (subType == "processPath" && type == simpleProcessPath)
{
const QString& address = content.section(':', 1);
if (!rule->process_path.contains(address)) rule->process_path.append(address);
return true;
} else if (subType == "processName" && type == simpleProcessName && sp.size() == 2)
{
const QString& address = sp[1];
if (!rule->process_name.contains(address)) rule->process_name.append(address);
return true;
} else
{
return false;