Avoid dereferencing $ENV{HOME} if it is undefined
This commit is contained in:
parent
74defd4812
commit
b42cb89fdd
1 changed files with 5 additions and 1 deletions
|
@ -598,7 +598,11 @@ sub check_packages {
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
sub get_config_file_options {
|
sub get_config_file_options {
|
||||||
my @defaults = ();
|
my @defaults = ();
|
||||||
for my $file ("$ENV{HOME}/.stowrc", '.stowrc') {
|
my @dirlist = ('.stowrc');
|
||||||
|
if (defined($ENV{HOME})) {
|
||||||
|
unshift(@dirlist, "$ENV{HOME}/.stowrc");
|
||||||
|
}
|
||||||
|
for my $file (@dirlist) {
|
||||||
if (-r $file) {
|
if (-r $file) {
|
||||||
warn "Loading defaults from $file\n";
|
warn "Loading defaults from $file\n";
|
||||||
open my $FILE, '<', $file
|
open my $FILE, '<', $file
|
||||||
|
|
Loading…
Reference in a new issue