[PATCH v2] gitweb: allow space as delimiter in mime.types
- From
- Ludwig Nussel <ludwig.nussel@suse.de>
- Date
- Jun 15, 2011, 06:10 UTC
- Message-ID
- <1308118208-30845-1-git-send-email-ludwig.nussel@suse.de>
- In-Reply-To
- <7v62o8ksq5.fsf@alter.siamese.dyndns.org>
in openSUSE /etc/mime.types has only spaces. I don't know if there's a canonical reference that says that only tabs are allowed. Mutt at least also accepts spaces. So make gitweb more liberal too.
Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de> --- gitweb/gitweb.perl | 9 +++------ 1 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 1b83a8d..d81d87b 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -3560,12 +3560,9 @@ sub mimetype_guess_file { open(my $mh, '<', $mimemap) or return undef; while (<$mh>) { next if m/^#/; # skip comments - my ($mimetype, $exts) = split(/\t+/); - if (defined $exts) { - my @exts = split(/\s+/, $exts); - foreach my $ext (@exts) { - $mimemap{$ext} = $mimetype; - } + my ($mimetype, @exts) = split(/\s+/); + foreach my $ext (@exts) { + $mimemap{$ext} = $mimetype; } } close($mh);
-- 1.7.3.4