mirror of
https://github.com/OpenMW/openmw.git
synced 2025-12-13 19:43:07 +00:00
Don't mangle settings with the comment character in their value
'#' is a valid character in setting values - it's only a comment if it's the first non-" \t\r\n" character on a line. Making the comment ignoring match the parser we use elsewhere should avoid mangling data.
This commit is contained in:
parent
fe047d98b1
commit
88fe079f95
1 changed files with 3 additions and 5 deletions
|
|
@ -352,12 +352,10 @@ MwIniImporter::multistrmap MwIniImporter::loadCfgFile(const std::filesystem::pat
|
||||||
std::string line;
|
std::string line;
|
||||||
while (std::getline(file, line))
|
while (std::getline(file, line))
|
||||||
{
|
{
|
||||||
|
// ignore comments - keep in sync with configfileparser.cpp
|
||||||
// we cant say comment by only looking at first char anymore
|
if (line.find('#') == line.find_first_not_of(" \t\r\n"))
|
||||||
int comment_pos = static_cast<int>(line.find('#'));
|
|
||||||
if (comment_pos > 0)
|
|
||||||
{
|
{
|
||||||
line = line.substr(0, comment_pos);
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (line.empty())
|
if (line.empty())
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue