From 2e95c4913b2f60100f8867ecebbbcbfc2091480f Mon Sep 17 00:00:00 2001 From: Christopher Felegy Date: Wed, 5 Jun 2019 17:13:29 -0400 Subject: [PATCH] fix: ignore escape behavior on remainder parameters (#994) Co-authored-by: Quahu --- src/Discord.Net.Commands/CommandParser.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Discord.Net.Commands/CommandParser.cs b/src/Discord.Net.Commands/CommandParser.cs index 96747ae964..c77b56042c 100644 --- a/src/Discord.Net.Commands/CommandParser.cs +++ b/src/Discord.Net.Commands/CommandParser.cs @@ -53,6 +53,13 @@ char GetMatch(IReadOnlyDictionary dict, char ch) else c = '\0'; + //If we're processing an remainder parameter, ignore all other logic + if (curParam != null && curParam.IsRemainder && curPos != endPos) + { + argBuilder.Append(c); + continue; + } + //If this character is escaped, skip it if (isEscaping) { @@ -79,13 +86,6 @@ char GetMatch(IReadOnlyDictionary dict, char ch) continue; } - //If we're processing an remainder parameter, ignore all other logic - if (curParam != null && curParam.IsRemainder && curPos != endPos) - { - argBuilder.Append(c); - continue; - } - //If we're not currently processing one, are we starting the next argument yet? if (curPart == ParserPart.None) {