Don't attempt to read file if open fails

This commit is contained in:
Richard Hansen 2024-05-14 20:39:49 -04:00
parent 2eacc71acc
commit 5cad38a047

View file

@ -1664,6 +1664,7 @@ sub _read_config {
local *FD; local *FD;
if (!open(FD, "< $file")) { if (!open(FD, "< $file")) {
warning("Cannot open file '%s'. (%s)", $file, $!); warning("Cannot open file '%s'. (%s)", $file, $!);
goto done;
} }
# If file is owned by our effective uid, ensure that it has no access for group or others. # If file is owned by our effective uid, ensure that it has no access for group or others.
@ -1809,6 +1810,7 @@ sub _read_config {
warning("file ends while expecting a continuation line.") warning("file ends while expecting a continuation line.")
if $continuation; if $continuation;
done:
%$globals = %globals; %$globals = %globals;
%$config = %config; %$config = %config;