diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2010-09-30 13:42:54 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-09-30 12:20:31 -0700 |
commit | c6038169a77854c26536f1c95176cbeb237e9e11 (patch) | |
tree | 15b17b5c6c0f6b4acccb487a6df9c71659df8f22 | |
parent | 9855b08d35edf8a8a441f24ff7b00e220a29f261 (diff) | |
download | git-c6038169a77854c26536f1c95176cbeb237e9e11.tar.gz git-c6038169a77854c26536f1c95176cbeb237e9e11.tar.xz |
send-email: use lexical filehandle for opendir
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.comReviewed-by: Avery Pennarun <apenwarr@gmail.com>
Reviewed-by: Jeff King <peff@peff.net>
>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-x | git-send-email.perl | 6 |
1 files 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 { |