summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Ward <planet36@users.noreply.github.com>2024-01-30 20:12:58 -0500
committerSteven Ward <planet36@users.noreply.github.com>2024-01-30 20:12:58 -0500
commit69363487bc3888cb5d975409f890a4ef4b51a8a2 (patch)
tree7bbee71ba13c575f399df0ab45b918027df0dcae
parentedcb68cbb91c71de6c890f9392756f1ca15955d4 (diff)
Write newline at end of config file
-rw-r--r--src/btop_config.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/btop_config.cpp b/src/btop_config.cpp
index 18e60ae..3bff815 100644
--- a/src/btop_config.cpp
+++ b/src/btop_config.cpp
@@ -729,9 +729,9 @@ namespace Config {
if (geteuid() != Global::real_uid and seteuid(Global::real_uid) != 0) return;
std::ofstream cwrite(conf_file, std::ios::trunc);
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) {
- cwrite << "\n\n" << (description.empty() ? "" : description + "\n")
+ cwrite << "\n" << (description.empty() ? "" : description + "\n")
<< name << " = ";
if (strings.contains(name))
cwrite << "\"" << strings.at(name) << "\"";
@@ -739,6 +739,7 @@ namespace Config {
cwrite << ints.at(name);
else if (bools.contains(name))
cwrite << (bools.at(name) ? "True" : "False");
+ cwrite << "\n";
}
}
}