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-Url: https://git.ladys.computer/Gitweb/commitdiff_plain/07a38235543969afd74df51459ed5074939dc62497f9e4d053ab0bd0abb9ac15?ds=sidebyside 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.perl b/gitweb.perl index 8c0e473..fae65b7 100755 --- a/gitweb.perl +++ b/gitweb.perl @@ -1197,7 +1197,7 @@ sub mimetype_guess_file { } close(MIME); - $filename =~ /\.(.*?)$/; + $filename =~ /\.([^.]*)$/; return $mimemap{$1}; }