From 24cad87954cc1368832e72b1cb18edfcfc446185 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Thu, 27 Feb 2025 20:12:53 +0800 Subject: [PATCH] Bug fix https://github.com/2dust/v2rayN/issues/6812 --- v2rayN/ServiceLib/Common/ProcUtils.cs | 4 ++++ v2rayN/ServiceLib/Handler/CoreHandler.cs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/v2rayN/ServiceLib/Common/ProcUtils.cs b/v2rayN/ServiceLib/Common/ProcUtils.cs index ded6f4d8..70b6f3c6 100644 --- a/v2rayN/ServiceLib/Common/ProcUtils.cs +++ b/v2rayN/ServiceLib/Common/ProcUtils.cs @@ -20,9 +20,13 @@ public static class ProcUtils try { if (fileName.Contains(' ')) + { fileName = fileName.AppendQuotes(); + } if (arguments.Contains(' ')) + { arguments = arguments.AppendQuotes(); + } Process proc = new() { diff --git a/v2rayN/ServiceLib/Handler/CoreHandler.cs b/v2rayN/ServiceLib/Handler/CoreHandler.cs index b01f6d9f..8f6200b9 100644 --- a/v2rayN/ServiceLib/Handler/CoreHandler.cs +++ b/v2rayN/ServiceLib/Handler/CoreHandler.cs @@ -253,7 +253,7 @@ namespace ServiceLib.Handler StartInfo = new() { FileName = fileName, - Arguments = string.Format(coreInfo.Arguments, coreInfo.AbsolutePath ? Utils.GetBinConfigPath(configPath) : configPath), + Arguments = string.Format(coreInfo.Arguments, coreInfo.AbsolutePath ? Utils.GetBinConfigPath(configPath).AppendQuotes() : configPath), WorkingDirectory = Utils.GetBinConfigPath(), UseShellExecute = false, RedirectStandardOutput = displayLog,