From: Ludwig Nussel Date: Wed, 15 Jun 2011 06:10:08 +0000 (+0200) Subject: gitweb: allow space as delimiter in mime.types X-Git-Tag: v1.7.7-rc0~105^2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=93a6ad16a64acd0970799adc5039df3455f2d4f9;p=git.git 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 --- 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);