Skip to content

Commit

Permalink
Test for both \n and \r in ConfigNode parsing. Close #167
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanKell committed Nov 6, 2023
1 parent 7a6a5a5 commit 246ea78
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions KSPCommunityFixes/Performance/ConfigNodePerf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ public static unsafe ConfigNode ParseConfigNode(char* pBase, int numChars)
// first eat the rest of the line, if it's a comment
if (mode == ParseMode.EatComment)
{
if (c == '\n')
if (c == '\n' || c == '\r')
{
mode = ParseMode.SkipToKey;
start = pos + 1;
Expand All @@ -803,7 +803,7 @@ public static unsafe ConfigNode ParseConfigNode(char* pBase, int numChars)
if (char.IsWhiteSpace(c))
{
// handle EOL
if (c == '\n')
if (c == '\n' || c == '\r')
{
//ProcessString(pBase, start, lastNonWS);
if (mode == ParseMode.ReadKey)
Expand Down

0 comments on commit 246ea78

Please sign in to comment.