From: Thomas Vander Stichele Date: Tue, 29 Oct 2002 19:12:14 +0000 (+0000) Subject: fix two dots in one filename only get bit after last dot X-Git-Tag: 1.19.3~511^2~15712 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1197e1cdb378ad99f39c44ed30211b02525f018e;p=platform%2Fupstream%2Fgstreamer.git 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 --- diff --git a/tools/gst-launch-ext b/tools/gst-launch-ext index d61d34d..193c255 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; }