Browse files

Truncating file before writing it out. Helps avoiding confusion :-)

  • Loading branch information...
1 parent 4144b9e commit 18fd02671b8a65bf96f5f8519030c6c0311804fd @lwille committed Dec 5, 2010
Showing with 1 addition and 0 deletions.
  1. +1 −0 usr/sbin/resolver
View
1 usr/sbin/resolver
@@ -17,6 +17,7 @@ config['files'].each do |k,file|
content=fd.read
if content.gsub!(/(# BEGIN allowed_hosts\n)(.*)(\n# END allowed_hosts)/m,"# BEGIN allowed_hosts\n#{lines}\n# END allowed_hosts")
fd.rewind
+ fd.truncate 0
puts "\tsaving file"
fd.write content
else

0 comments on commit 18fd026

Please sign in to comment.