send-email: use catfile() to concatenate files
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>
Ævar Arnfjörð Bjarmason committed
Sep 14, 2010 at 19:02 UTC
89bf1bace388c118137261e852635db92e607888
1 file changed
+2
-1
git-send-email.perl
+2
-1
@@ -24,6 +24,7 @@ use Text::ParseWords;
24
use Data::Dumper;
25
use Term::ANSIColor;
26
use File::Temp qw/ tempdir tempfile /;
27
+use File::Spec::Functions qw(catfile);
28
use Error qw(:try);
29
use Git;
30
@@ -511,7 +512,7 @@ while (defined(my $f = shift @ARGV)) {
512
opendir(DH,$f)
513
or die "Failed to opendir $f: $!";
514
514
- push @files, grep { -f $_ } map { +$f . "/" . $_ }
515
+ push @files, grep { -f $_ } map { catfile($f, $_) }
516
sort readdir(DH);
517
closedir(DH);
518
} elsif ((-f $f or -p $f) and !check_file_rev_conflict($f)) {