From 7b1729a85bd511d591e620fcc32985a76180358f Mon Sep 17 00:00:00 2001 From: Cedric Date: Sun, 20 Mar 2016 12:12:11 +0100 Subject: [PATCH] i3-dmenu-desktop: do not die on failed open --- i3-dmenu-desktop | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/i3-dmenu-desktop b/i3-dmenu-desktop index a0549ead..3b81cb20 100755 --- a/i3-dmenu-desktop +++ b/i3-dmenu-desktop @@ -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 { -- 2.39.5