From caa7856fed135b4636b423d9af4bb83abc702522 Mon Sep 17 00:00:00 2001 From: wfowler Date: Sat, 14 Jul 2018 23:59:45 -0600 Subject: [PATCH] Whoops, don't escape with backslashes here also. --- LibBSP/Source/Structs/Common/Entity.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/LibBSP/Source/Structs/Common/Entity.cs b/LibBSP/Source/Structs/Common/Entity.cs index 7d2455f..8a8bcde 100644 --- a/LibBSP/Source/Structs/Common/Entity.cs +++ b/LibBSP/Source/Structs/Common/Entity.cs @@ -314,9 +314,10 @@ namespace LibBSP { bool inQuotes = false; bool isVal = false; int numCommas = 0; + st.Trim('\r', '\n', '\t'); for (int i = 0; i < st.Length; ++i) { // Some entity values in Source can use escape sequenced quotes. Need to make sure not to parse those. - if (st[i] == '\"' && (i == 0 || st[i - 1] != '\\')) { + if (st[i] == '\"' && (i == 0 || i == st.Length - 1 || st[i - 1] != '\\')) { if (inQuotes) { if (isVal) { break;