Skip to content

Commit

Permalink
gitweb: Fix mimetype_guess_file for files with multiple extensions
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jakub Narebski authored and Junio C Hamano committed Sep 20, 2006
1 parent c774b2d commit 8059319
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -1197,7 +1197,7 @@ sub mimetype_guess_file {
}
close(MIME);

$filename =~ /\.(.*?)$/;
$filename =~ /\.([^.]*)$/;
return $mimemap{$1};
}

Expand Down

0 comments on commit 8059319

Please sign in to comment.