Skip to content

Commit

Permalink
send-email: use catfile() to concatenate files
Browse files Browse the repository at this point in the history
Change send-email to use Perl's catfile() function instead of
"$dir/$file". If send-email is given a $dir that ends with a / we'll
end up printing a double slashed path like "dir//mtfnpy.patch".

This doesn't cause any problems since Perl's IO layer will handle it,
but it looks ugly.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Ævar Arnfjörð Bjarmason authored and Junio C Hamano committed Sep 14, 2010
1 parent 5879b6b commit 89bf1ba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion git-send-email.perl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use Data::Dumper;
use Term::ANSIColor;
use File::Temp qw/ tempdir tempfile /;
use File::Spec::Functions qw(catfile);
use Error qw(:try);
use Git;

Expand Down Expand Up @@ -511,7 +512,7 @@ ($)
opendir(DH,$f)
or die "Failed to opendir $f: $!";

push @files, grep { -f $_ } map { +$f . "/" . $_ }
push @files, grep { -f $_ } map { catfile($f, $_) }
sort readdir(DH);
closedir(DH);
} elsif ((-f $f or -p $f) and !check_file_rev_conflict($f)) {
Expand Down

0 comments on commit 89bf1ba

Please sign in to comment.