From a672e2c082559edfcf686199eeef2411abe78ab0 Mon Sep 17 00:00:00 2001 From: "jrayhawk+piny.be@omgwallhack.org" Date: Mon, 20 Dec 2010 22:11:32 -0800 Subject: Make Piny::Config deal with empty config files a bit more gracefully. --- libpiny/lib/Piny/Config.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libpiny/lib/Piny/Config.pm') diff --git a/libpiny/lib/Piny/Config.pm b/libpiny/lib/Piny/Config.pm index 1242c8f..5cd99da 100644 --- a/libpiny/lib/Piny/Config.pm +++ b/libpiny/lib/Piny/Config.pm @@ -85,7 +85,7 @@ sub _build__conf { $conf = { }; }; - if ( -e "/etc/piny-default.conf" ) { + if ( -s "/etc/piny-default.conf" ) { my $default = Config::Simple->new( "/etc/piny-default.conf" )->vars; @@ -97,7 +97,7 @@ sub _build__conf { }; - if ( -e "/etc/piny-override.conf" ) { + if ( -s "/etc/piny-override.conf" ) { my $override = Config::Simple->new( "/etc/piny-override.conf" )->vars; @@ -119,7 +119,7 @@ sub save { croak "Can't save a Piny::Config if the confpath is not set!"; }; - if ( -e "/etc/piny-override.conf" ) { + if ( -s "/etc/piny-override.conf" ) { my $override = Config::Simple->new( "/etc/piny-override.conf" )->vars; @@ -131,7 +131,7 @@ sub save { }; - if ( -e "/etc/piny-default.conf" ) { + if ( -s "/etc/piny-default.conf" ) { my $default = Config::Simple->new( "/etc/piny-default.conf" )->vars; -- cgit v1.2.3