summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/archive.pl3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/archive.pl b/tests/archive.pl
index 0a03b23..76484f7 100644
--- a/tests/archive.pl
+++ b/tests/archive.pl
@@ -2,11 +2,12 @@
use Archive::Tar;
use Archive::Zip;
+use File::Basename;
my $target = shift @ARGV;
my @sources = @ARGV;
-my $basedir = ($target =~ /^(.*)(\.zip|\.tar.gz|\.tgz)$/) ? "$1/" : '';
+my $basedir = basename($target, ('.zip', '.tar.gz', '.tgz')) . '/';
my $zip = $target =~ /\.zip$/;
my $arch = $zip ? Archive::Zip->new : Archive::Tar->new;