mirror of
https://github.com/aristocratos/btop.git
synced 2024-05-18 19:33:03 +12:00
Merge pull request #743 from planet36/config-trailing-newline
This commit is contained in:
commit
c587c9f1e3
|
@ -732,9 +732,9 @@ namespace Config {
|
||||||
if (geteuid() != Global::real_uid and seteuid(Global::real_uid) != 0) return;
|
if (geteuid() != Global::real_uid and seteuid(Global::real_uid) != 0) return;
|
||||||
std::ofstream cwrite(conf_file, std::ios::trunc);
|
std::ofstream cwrite(conf_file, std::ios::trunc);
|
||||||
if (cwrite.good()) {
|
if (cwrite.good()) {
|
||||||
cwrite << "#? Config file for btop v. " << Global::Version;
|
cwrite << "#? Config file for btop v. " << Global::Version << "\n";
|
||||||
for (auto [name, description] : descriptions) {
|
for (auto [name, description] : descriptions) {
|
||||||
cwrite << "\n\n" << (description.empty() ? "" : description + "\n")
|
cwrite << "\n" << (description.empty() ? "" : description + "\n")
|
||||||
<< name << " = ";
|
<< name << " = ";
|
||||||
if (strings.contains(name))
|
if (strings.contains(name))
|
||||||
cwrite << "\"" << strings.at(name) << "\"";
|
cwrite << "\"" << strings.at(name) << "\"";
|
||||||
|
@ -742,6 +742,7 @@ namespace Config {
|
||||||
cwrite << ints.at(name);
|
cwrite << ints.at(name);
|
||||||
else if (bools.contains(name))
|
else if (bools.contains(name))
|
||||||
cwrite << (bools.at(name) ? "True" : "False");
|
cwrite << (bools.at(name) ? "True" : "False");
|
||||||
|
cwrite << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue