diff options
author | jrayhawk+piny.be@omgwallhack.org <jrayhawk@dev.piny.svcs.cs.pdx.edu> | 2010-12-20 22:11:32 -0800 |
---|---|---|
committer | jrayhawk+piny.be@omgwallhack.org <jrayhawk@dev.piny.svcs.cs.pdx.edu> | 2010-12-20 22:11:32 -0800 |
commit | a672e2c082559edfcf686199eeef2411abe78ab0 (patch) | |
tree | 528d6a216d1b57c4da71ddbae9419123996b3cb6 /libpiny/lib/Piny/Config.pm | |
parent | 10f282b3a4930a84cdca247e4bb771f428bd778e (diff) | |
download | piny-code-a672e2c082559edfcf686199eeef2411abe78ab0.tar.gz piny-code-a672e2c082559edfcf686199eeef2411abe78ab0.zip |
Make Piny::Config deal with empty config files a bit more gracefully.
Diffstat (limited to 'libpiny/lib/Piny/Config.pm')
-rw-r--r-- | libpiny/lib/Piny/Config.pm | 8 |
1 files changed, 4 insertions, 4 deletions
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; |