Skip to content

Commit c603816

Browse files
avargitster
authored andcommitted
send-email: use lexical filehandle for opendir
Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]: Avery Pennarun <[email protected]> Reviewed-by: Jeff King <[email protected]> > Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9855b08 commit c603816

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

git-send-email.perl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -512,12 +512,12 @@ ($)
512512
push @rev_list_opts, "--", @ARGV;
513513
@ARGV = ();
514514
} elsif (-d $f and !check_file_rev_conflict($f)) {
515-
opendir(DH,$f)
515+
opendir my $dh, $f
516516
or die "Failed to opendir $f: $!";
517517

518518
push @files, grep { -f $_ } map { catfile($f, $_) }
519-
sort readdir(DH);
520-
closedir(DH);
519+
sort readdir $dh;
520+
closedir $dh;
521521
} elsif ((-f $f or -p $f) and !check_file_rev_conflict($f)) {
522522
push @files, $f;
523523
} else {

0 commit comments

Comments
 (0)