summaryrefslogtreecommitdiff
path: root/src/Propellor
diff options
context:
space:
mode:
authorJoey Hess2019-04-08 11:13:56 -0400
committerJoey Hess2019-04-08 11:14:04 -0400
commit35435e16b63771c65f8223ff3fd2580cc8bad856 (patch)
tree54f665d1e6b2d7051d1fbe5c4f5f7ccdc47be314 /src/Propellor
parent7f59e2b84488243fa6b646f0b4bbb23ce2393cee (diff)
Fix bug in File.containsShellSetting
It replaced whole shell conffile content with the setting if the file did not previously contain a line setting the key to some value. InsertSection is passed the whole content of the file, which does not contain the section yet (here the section is a single line). Probably this was not noticed because it's common for a shell config file to contain default values, so the buggy InsertSection rarely gets used. This commit was sponsored by Ethan Aubin.
Diffstat (limited to 'src/Propellor')
-rw-r--r--src/Propellor/Property/ConfFile.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Propellor/Property/ConfFile.hs b/src/Propellor/Property/ConfFile.hs
index 0682e466..95e2c2d5 100644
--- a/src/Propellor/Property/ConfFile.hs
+++ b/src/Propellor/Property/ConfFile.hs
@@ -161,7 +161,7 @@ containsShellSetting f (k, v) = adjust `before` dedup
isline
(not . isline)
(const [line])
- (const [line])
+ (++ [line])
f
dedup = fileProperty "" dedup' f
dedup' ls = let (pre, wanted, post) = foldl' find ([], [], []) ls