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 <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Jakub Narebski 2006-09-19 13:57:03 +02:00 committed by Junio C Hamano
parent c774b2dcf6
commit 8059319acc

View File

@ -1197,7 +1197,7 @@ sub mimetype_guess_file {
}
close(MIME);
$filename =~ /\.(.*?)$/;
$filename =~ /\.([^.]*)$/;
return $mimemap{$1};
}