From fba734fd5a10a046754d071f7971cf23c72ae936 Mon Sep 17 00:00:00 2001
From: chylex <contact@chylex.com>
Date: Tue, 27 Jun 2017 20:28:55 +0200
Subject: [PATCH] Fix new lines not being recognized in CEF argument parser

---
 Core/Utils/CommandLineArgsParser.cs           | 2 +-
 tests/Core/Utils/TestCommandLineArgsParser.cs | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Core/Utils/CommandLineArgsParser.cs b/Core/Utils/CommandLineArgsParser.cs
index 2635ac42..7c3397bf 100644
--- a/Core/Utils/CommandLineArgsParser.cs
+++ b/Core/Utils/CommandLineArgsParser.cs
@@ -3,7 +3,7 @@
 
 namespace TweetDuck.Core.Utils{
     static class CommandLineArgsParser{
-        private static readonly Lazy<Regex> SplitRegex = new Lazy<Regex>(() => new Regex(@"([^=\s]+(?:=(?:[^ ]*""[^""]*?""[^ ]*|[^ ]*))?)", RegexOptions.Compiled), false);
+        private static readonly Lazy<Regex> SplitRegex = new Lazy<Regex>(() => new Regex(@"([^=\s]+(?:=(?:\S*""[^""]*?""\S*|\S*))?)", RegexOptions.Compiled), false);
         
         public static CommandLineArgs ReadCefArguments(string argumentString){
             CommandLineArgs args = new CommandLineArgs();
diff --git a/tests/Core/Utils/TestCommandLineArgsParser.cs b/tests/Core/Utils/TestCommandLineArgsParser.cs
index a9a40e6d..ececcfd4 100644
--- a/tests/Core/Utils/TestCommandLineArgsParser.cs
+++ b/tests/Core/Utils/TestCommandLineArgsParser.cs
@@ -12,7 +12,7 @@ public void TestEmptyString(){
 
         [TestMethod]
         public void TestValidString(){
-            CommandLineArgs args = CommandLineArgsParser.ReadCefArguments("--aaa --bbb --first-value=123 --SECOND-VALUE=\"a b c d e\" --ccc");
+            CommandLineArgs args = CommandLineArgsParser.ReadCefArguments("--aaa --bbb --first-value=123 --SECOND-VALUE=\"a b c d e\"\r\n--ccc");
             // cef has no flags, flag arguments have a value of 1
             // the processing removes all dashes in front of each key