Merge pull request #2266 from cedricbu/dmenu-death-by-failed-open
i3-dmenu-desktop: do not die on failed open
This commit is contained in:
commit
eb837cbd00
|
@ -25,7 +25,11 @@ binmode STDERR, ':utf8';
|
|||
# reads in a whole file
|
||||
sub slurp {
|
||||
my ($filename) = @_;
|
||||
open(my $fh, '<', $filename) or die "$!";
|
||||
my $fh;
|
||||
if (!open($fh, '<', $filename)) {
|
||||
warn "Could not open $filename: $!";
|
||||
return undef;
|
||||
}
|
||||
local $/;
|
||||
my $result;
|
||||
eval {
|
||||
|
|
Loading…
Reference in New Issue