Skip to content

Commit 04f9185

Browse files
committed
Fixed bug with logging preamble/postamble sequence
1 parent 19345c3 commit 04f9185

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

ProcessPreviousLine.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,18 @@ void CMUSHclientDoc::LogLineInHTMLcolour (POSITION startpos)
7373
bInSpan = false;
7474
}
7575

76-
WriteToLog (CFormat ("</font><font color=\"#%02X%02X%02X\">",
76+
// wrap up last colour change
77+
if (prevcolour != NO_COLOUR)
78+
WriteToLog ("</font>");
79+
80+
WriteToLog (CFormat ("<font color=\"#%02X%02X%02X\">",
7781
GetRValue (colour1),
7882
GetGValue (colour1),
7983
GetBValue (colour1)
8084
));
8185

86+
prevcolour = colour1;
87+
8288
// for efficiency we will only use <span> if we need to change the
8389
// background colour
8490
if (colour2 != 0) // ie. not black
@@ -122,7 +128,7 @@ void CMUSHclientDoc::LogLineInHTMLcolour (POSITION startpos)
122128
WriteToLog ("</span>");
123129

124130
// wrap up last colour change
125-
if (prevcolour != -1)
131+
if (prevcolour != NO_COLOUR)
126132
WriteToLog ("</font>");
127133

128134
} // end of CMUSHclientDoc::LogLineInHTMLcolour

0 commit comments

Comments
 (0)