[Core] Fix writing of multiline values in config.

This commit is contained in:
gibbed 2019-08-04 13:00:15 -05:00
parent 41b8dbdd76
commit bbe4d416ff
1 changed files with 4 additions and 3 deletions

View File

@ -95,12 +95,13 @@ void SaveConfig() {
auto lines = xe::split_string(value, "\n");
auto first_it = lines.cbegin();
output << xe::format_string("%s = %s\n", config_var->name().c_str(),
*first_it);
(*first_it).c_str());
auto last_it = std::prev(lines.cend());
for (auto it = std::next(first_it); it != last_it; ++it) {
output << *it << "\n";
output << (*it).c_str() << "\n";
}
output << std::left << std::setw(40) << std::setfill(' ') << *last_it;
output << std::left << std::setw(40) << std::setfill(' ')
<< (*last_it).c_str();
}
output << xe::format_string("\t# %s\n", config_var->description().c_str());
}