open file later to remove risk of emptying config file
authorgc <gc>
Sat, 31 May 2008 22:34:34 +0000 (22:34 +0000)
committergc <gc>
Sat, 31 May 2008 22:34:34 +0000 (22:34 +0000)
bin/booh

index 67254d0..fbc1864 100755 (executable)
--- a/bin/booh
+++ b/bin/booh
@@ -179,7 +179,6 @@ def write_config
         $config['last-opens'] = $config['last-opens'][-10, 10]
     end
 
-    ios = File.open($config_file, "w")
     $xmldoc = Document.new "<booh-gui-rc version='#{$VERSION}'/>"
     $xmldoc << XMLDecl.new(XMLDecl::DEFAULT_VERSION, $CURRENT_CHARSET)
     $config.each_pair { |key, value|
@@ -199,6 +198,7 @@ def write_config
             end
         end
     }
+    ios = File.open($config_file, "w")
     $xmldoc.write(ios, 0)
     ios.close