From f93942f4d4fb7905df02aabc28775134d2a57341 Mon Sep 17 00:00:00 2001 From: Mozi <29089388+pzhlkj6612@users.noreply.github.com> Date: Mon, 26 Oct 2020 18:26:08 +0800 Subject: [PATCH] Upd the index of the semicolon after truncation. --- CSSCompare/Program.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CSSCompare/Program.cs b/CSSCompare/Program.cs index 828e888..583b16e 100644 --- a/CSSCompare/Program.cs +++ b/CSSCompare/Program.cs @@ -269,12 +269,18 @@ private static void AddNormalizedLine(string line, ref StringBuilder output) int semicolon = currentLine.IndexOf(";"); while (semicolon > -1 && !string.IsNullOrEmpty(currentLine)) { - // Handle empty lines. + // Handle lines starting with a semicolon. if (semicolon == 0) { if (currentLine.Length > 1) + { currentLine = currentLine.Substring(1); + semicolon = currentLine.IndexOf(";"); + continue; + } else + { return; + } } if (semicolon < currentLine.Length - 1)