From ab8625cb9ca47f29ee07ad7ca8728371002b33b8 Mon Sep 17 00:00:00 2001 From: MathiasL Date: Tue, 24 May 2022 22:44:14 +0200 Subject: [PATCH] Fix leading whitespaces corrupting commands --- SteamShared/SteamShared/SteamShared/SourceConfig/SourceCFG.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SteamShared/SteamShared/SteamShared/SourceConfig/SourceCFG.cs b/SteamShared/SteamShared/SteamShared/SourceConfig/SourceCFG.cs index 0171732..6986d04 100644 --- a/SteamShared/SteamShared/SteamShared/SourceConfig/SourceCFG.cs +++ b/SteamShared/SteamShared/SteamShared/SourceConfig/SourceCFG.cs @@ -99,7 +99,9 @@ namespace SteamShared.SourceConfig // We've reached end of line, a gap between commands or just padding, a quote or the end of command, always break at newlines or semis // We might be at the first unquoted space after a command as well, this would mean... oh yeah! we finally finished fetching that command name! - cmdNameParsed = true; + // But if there's unwanted whitespaces BEFORE the command we would break prematurely, so make sure it actually has content + if(!cmdNameParsed && !string.IsNullOrWhiteSpace(cmdString.ToString())) + cmdNameParsed = true; wasInQuoted = false; if (curChar == '\"')