diff options
author | Thomas Vander Stichele <thomas@apestaart.org> | 2002-10-29 19:12:14 +0000 |
---|---|---|
committer | Thomas Vander Stichele <thomas@apestaart.org> | 2002-10-29 19:12:14 +0000 |
commit | 21e2513a1a51e02a04150b09aef6def424cf02d3 (patch) | |
tree | 1ccfa8e7dfe4a99cb1e97c394571dc3cc1b0c1aa /tools | |
parent | ad8eed3dc0711286325c50a8068252aea0eefaf4 (diff) |
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
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/gst-launch-ext | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tools/gst-launch-ext b/tools/gst-launch-ext index d61d34d3..193c2555 100755 --- a/tools/gst-launch-ext +++ b/tools/gst-launch-ext @@ -13,8 +13,17 @@ my (%pipes, %cfg); sub extension { my $path = shift; - my $ext = (fileparse ($path, '\..*?'))[2]; - $ext =~ s/^\.//; + my $ext; + + # 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; } |