From 93a6ad16a64acd0970799adc5039df3455f2d4f9 Mon Sep 17 00:00:00 2001 From: Ludwig Nussel Date: Wed, 15 Jun 2011 08:10:08 +0200 Subject: [PATCH] gitweb: allow space as delimiter in mime.types 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 Acked-by: Jakub Narebski Acked-by: John 'Warthog9' Hawley Signed-off-by: Junio C Hamano --- gitweb/gitweb.perl | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index f8db40a1c..fc689f837 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -3383,12 +3383,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); -- 2.30.2