Skip to content
This repository was archived by the owner on Jan 1, 2025. It is now read-only.

Update the index of the semicolon after truncating the line starting with a semicolon #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CSSCompare/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down