From db03abf6914beeca09ee975120ff5ce2091c8dca Mon Sep 17 00:00:00 2001 From: Paddy Xu Date: Wed, 25 Aug 2021 20:35:54 +0200 Subject: [PATCH] revert e1379908c36b1dc674df730741c5e125a9c19918 --- LEProc/Program.cs | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/LEProc/Program.cs b/LEProc/Program.cs index 8b21d3b..c84163e 100644 --- a/LEProc/Program.cs +++ b/LEProc/Program.cs @@ -4,7 +4,6 @@ using System.IO; using System.Linq; using System.Reflection; -using System.Text.RegularExpressions; using System.Windows.Forms; using LECommonLibrary; @@ -89,17 +88,7 @@ private static void Main(string[] args) try { - // To keep original quotes in the command line. If we directly use args[] to make the command line, - // {_cmd1.exe / c _cmd2.exe "path with space"} will become {_cmd1.exe / c _cmd2.exe path with space} - // and will cause issues. - var argWithQuotesList = Regex.Matches(Environment.CommandLine, @"[\""].+?[\""]|[^ ]+") - .Cast() - .ToArray(); - Args = new string[argWithQuotesList.Length - 1]; - for (var i = 1; i < argWithQuotesList.Length; i += 1) - { - Args[i - 1] = argWithQuotesList[i].ToString(); - } + Args = args; switch (Args[0]) { @@ -123,9 +112,9 @@ private static void Main(string[] args) break; default: - if (File.Exists(Args[0].Trim('"'))) + if (File.Exists(Args[0])) { - RunWithDefaultProfile(Args[0].Trim('"')); + RunWithDefaultProfile(Args[0]); } break; }