fix: enforce single semicolon in directives and handle multiple semicolons
This commit is contained in:
parent
0aa1fd5bc1
commit
fe3b28fbfe
@ -22,8 +22,12 @@ void AConfig::addDirective(const std::string &line)
|
|||||||
++semicolon_count;
|
++semicolon_count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (semicolon_count > 1)
|
||||||
|
{
|
||||||
|
throw std::runtime_error("Directive contains multiple semicolons: " + line);
|
||||||
|
}
|
||||||
|
|
||||||
if (semicolon_count != 1 || line.back() != ';')
|
if (line.back() != ';')
|
||||||
{
|
{
|
||||||
throw std::runtime_error("Directive must end with a single semicolon");
|
throw std::runtime_error("Directive must end with a single semicolon");
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user