mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 15:45:31 +00:00
Make sure blank lines at the end of settings.cfg don't disappear
This commit is contained in:
parent
99e89f23a6
commit
69219c18a7
1 changed files with 4 additions and 4 deletions
|
@ -103,18 +103,18 @@ void Settings::SettingsFileParser::saveSettingsFile(const std::string& file, con
|
|||
// The current character position in the line.
|
||||
size_t i = 0;
|
||||
|
||||
// Don't add additional newlines at the end of the file.
|
||||
if (istream.eof()) continue;
|
||||
|
||||
// An empty line was queued.
|
||||
if (emptyLineQueued)
|
||||
{
|
||||
emptyLineQueued = false;
|
||||
// We're still going through the current category, so we should copy it.
|
||||
if (currentCategory.empty() || line[i] != '[')
|
||||
if (currentCategory.empty() || istream.eof() || line[i] != '[')
|
||||
ostream << std::endl;
|
||||
}
|
||||
|
||||
// Don't add additional newlines at the end of the file otherwise.
|
||||
if (istream.eof()) continue;
|
||||
|
||||
// Queue entirely blank lines to add them if desired.
|
||||
if (!skipWhiteSpace(i, line))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue