Config: Fix some errors in the comment handling

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter
2011-04-01 21:23:11 +02:00
parent 90fb9e8c29
commit 2003465489
2 changed files with 9 additions and 16 deletions
+7 -16
View File
@@ -76,26 +76,17 @@ bool CConfig::Parse(CFile& file, CString& sErrorMsg)
sLine.TrimLeft();
sLine.TrimRight("\r\n");
if (bCommented || sLine.Left(2) == "/*") {
/* Does this comment end on the same line again? */
bCommented = (sLine.Right(2) != "*/");
continue;
}
if ((sLine.empty()) || (sLine[0] == '#') || (sLine.Left(2) == "//")) {
continue;
}
if (sLine.Left(2) == "/*") {
if (sLine.Right(2) != "*/") {
bCommented = true;
}
continue;
}
if (bCommented) {
if (sLine.Right(2) == "*/") {
bCommented = false;
}
continue;
}
if ((sLine.Left(1) == "<") && (sLine.Right(1) == ">")) {
sLine.LeftChomp();
sLine.RightChomp();