Skip to content

Commit

Permalink
RT #119949: Correctly concat prefix on directories
Browse files Browse the repository at this point in the history
When concatenating the prefix & name fields of a tar header, any trailing
slashes in the name would be stripped off.  Re-add the trailing slash for
consistency with other directories in the tarball.
  • Loading branch information
ColMelvin authored and bingos committed Mar 25, 2023
1 parent 749282d commit 2d47379
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/Archive/Tar/File.pm
Expand Up @@ -486,7 +486,9 @@ sub full_path {
return $self->name unless defined $self->prefix and length $self->prefix;

### or otherwise, catfile'd
return File::Spec::Unix->catfile( $self->prefix, $self->name );
my $path = File::Spec::Unix->catfile( $self->prefix, $self->name );
$path .= "/" if $self->name =~ m{/$}; # Re-add trailing slash if necessary, as catfile() strips them off.
return $path;
}


Expand Down
1 change: 0 additions & 1 deletion t/09_roundtrip.t
Expand Up @@ -225,7 +225,6 @@ SKIP: {
chop $oldfiles[$i] if $directory_or_not[$i];
}

local $TODO = "RT #119949" if $archive_name =~ /prefix-directory-concat/;
# compare list of files
is_deeply(
[ $new->list_files ],
Expand Down

0 comments on commit 2d47379

Please sign in to comment.