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:
Michael Stapelberg 2016-03-24 09:40:19 +01:00
commit eb837cbd00
1 changed files with 5 additions and 1 deletions

View File

@ -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 {