Skip to content

Commit e2b8f4f

Browse files
committed
If Process.start contains spaces, add quotes
1 parent 1dcfe66 commit e2b8f4f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

v2rayN/ServiceLib/Common/Utils.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,9 @@ public static void ProcessStart(string? fileName, string arguments = "")
593593
return;
594594
}
595595

596+
if (fileName.Contains(' ')) fileName = fileName.AppendQuotes();
597+
if (arguments.Contains(' ')) arguments = arguments.AppendQuotes();
598+
596599
Process.Start(new ProcessStartInfo(fileName, arguments) { UseShellExecute = true });
597600
}
598601
catch (Exception ex)

0 commit comments

Comments
 (0)