From c6038169a77854c26536f1c95176cbeb237e9e11 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Thu, 30 Sep 2010 13:42:54 +0000 Subject: [PATCH] send-email: use lexical filehandle for opendir MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Ævar Arnfjörð Bjarmason Reviewed-by: Jeff King > Signed-off-by: Junio C Hamano --- git-send-email.perl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/git-send-email.perl b/git-send-email.perl index 8cc416115..2f18d8307 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -512,12 +512,12 @@ while (defined(my $f = shift @ARGV)) { push @rev_list_opts, "--", @ARGV; @ARGV = (); } elsif (-d $f and !check_file_rev_conflict($f)) { - opendir(DH,$f) + opendir my $dh, $f or die "Failed to opendir $f: $!"; push @files, grep { -f $_ } map { catfile($f, $_) } - sort readdir(DH); - closedir(DH); + sort readdir $dh; + closedir $dh; } elsif ((-f $f or -p $f) and !check_file_rev_conflict($f)) { push @files, $f; } else { -- 2.30.2