summaryrefslogtreecommitdiff
path: root/portato/config_parser.py
diff options
context:
space:
mode:
Diffstat (limited to 'portato/config_parser.py')
-rw-r--r--portato/config_parser.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/portato/config_parser.py b/portato/config_parser.py
index eb0d42a..b2b47a6 100644
--- a/portato/config_parser.py
+++ b/portato/config_parser.py
@@ -366,6 +366,14 @@ class ConfigParser:
part1 = self.cache[val.line][:self.pos[val.line][0]] # key+DELIMITER
part2 = val.value # value
part3 = self.cache[val.line][self.pos[val.line][1]:] # everything behind the vale (\n in normal cases)
+
+ if not val.old: # empty original value
+ add = ""
+ if part1.endswith("\n"):
+ part1 = part1[:-1]
+ add = "\n"
+ part3 = part3 + add
+
self.cache[val.line] = part1 + part2 + part3
# write