aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Narebski <jnareb@gmail.com>2006-09-19 13:57:03 +0200
committerJunio C Hamano <junkio@cox.net>2006-09-20 07:54:29 -0700
commit8059319acc3638c8398d1bd34f647a2b28f48d5c (patch)
treef93a08a01a3b202f1beb8d5efb46047664fd1862
parentc774b2dcf6c16a408757e9da1bf7c006528fc6a6 (diff)
downloadgit-8059319acc3638c8398d1bd34f647a2b28f48d5c.tar.gz
git-8059319acc3638c8398d1bd34f647a2b28f48d5c.tar.xz
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>
-rwxr-xr-xgitweb/gitweb.perl2
1 files changed, 1 insertions, 1 deletions
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};
}