From: Jakub Narebski Date: Tue, 19 Sep 2006 11:57:03 +0000 (+0200) Subject: gitweb: Fix mimetype_guess_file for files with multiple extensions X-Git-Tag: v1.4.3-rc1~78 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8059319acc3638c8398d1bd34f647a2b28f48d5c;p=git.git gitweb: Fix mimetype_guess_file for files with multiple extensions Fix getting correct mimetype for "blob_plain" view for files which have multiple extensions, e.g. foo.1.html; now only the last extension is used to find mimetype. Noticed by Martin Waitz. Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano --- diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index c77270c7c..969c2de95 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -1197,7 +1197,7 @@ sub mimetype_guess_file { } close(MIME); - $filename =~ /\.(.*?)$/; + $filename =~ /\.([^.]*)$/; return $mimemap{$1}; }