fix two dots in one filename only get bit after last dot
Original commit message from CVS: fix two dots in one filename only get bit after last dot
This commit is contained in:
parent
ad8eed3dc0
commit
21e2513a1a
@ -13,8 +13,17 @@ my (%pipes, %cfg);
|
|||||||
sub extension
|
sub extension
|
||||||
{
|
{
|
||||||
my $path = shift;
|
my $path = shift;
|
||||||
my $ext = (fileparse ($path, '\..*?'))[2];
|
my $ext;
|
||||||
$ext =~ s/^\.//;
|
|
||||||
|
# get only the bit after the last period. We don't deal with
|
||||||
|
# .tar.gz extensions do we ?
|
||||||
|
if ($path =~ /\./)
|
||||||
|
{
|
||||||
|
my $ext = $path;
|
||||||
|
$ext =~ s/^.*\.//;
|
||||||
|
}
|
||||||
|
else { $ext = ""; }
|
||||||
|
|
||||||
return $ext;
|
return $ext;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user