summaryrefslogtreecommitdiff
path: root/Echolot
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2004-11-14 22:39:13 +0000
committerPeter Palfrader <peter@palfrader.org>2004-11-14 22:39:13 +0000
commit147b25fc1aa8ed1501818e5918b69c8e4fe95c09 (patch)
treef34076d928df6b6b7b0cb1e49a78e9bfd3e474b5 /Echolot
parentda03613b37f02bca8a3960b34a56f0d25470185a (diff)
handle empty environment better - we would whine when HOME is not set previously.
Diffstat (limited to 'Echolot')
-rw-r--r--Echolot/Config.pm18
1 files changed, 9 insertions, 9 deletions
diff --git a/Echolot/Config.pm b/Echolot/Config.pm
index 147e98e..5ef4fda 100644
--- a/Echolot/Config.pm
+++ b/Echolot/Config.pm
@@ -68,15 +68,15 @@ sub init($) {
die ("Basedir is not defined\n") unless defined $params->{'basedir'};
- my @CONFIG_FILES =
- ( $ENV{'ECHOLOT_CONF'},
- $params->{'basedir'}.'/pingd.conf',
- $ENV{'HOME'}.'/echolot/pingd.conf',
- $ENV{'HOME'}.'/pingd.conf',
- $ENV{'HOME'}.'/.pingd.conf',
- '/etc/echolot/pingd.conf',
- '/etc/pingd.conf' );
-
+ my @CONFIG_FILES = ();
+ push(@CONFIG_FILES, $ENV{'ECHOLOT_CONF'}) if defined $ENV{'ECHOLOT_CONF'};
+ push(@CONFIG_FILES, $params->{'basedir'}.'/pingd.conf') if defined $params->{'basedir'};
+ push(@CONFIG_FILES, $ENV{'HOME'}.'/echolot/pingd.conf') if defined $ENV{'HOME'};
+ push(@CONFIG_FILES, $ENV{'HOME'}.'/pingd.conf') if defined $ENV{'HOME'};
+ push(@CONFIG_FILES, $ENV{'HOME'}.'/.pingd.conf') if defined $ENV{'HOME'};
+ push(@CONFIG_FILES, '/etc/echolot/pingd.conf');
+ push(@CONFIG_FILES, '/etc/pingd.conf');
+
my $DEFAULT;
$DEFAULT = {
# System Specific Options