]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: allow space as delimiter in mime.types
authorLudwig Nussel <redacted>
Wed, 15 Jun 2011 06:10:08 +0000 (08:10 +0200)
committerLady <redacted>
Mon, 6 Apr 2026 04:51:31 +0000 (00:51 -0400)
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 <redacted>
Acked-by: Jakub Narebski <redacted>
Acked-by: John 'Warthog9' Hawley <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl

index 60004e41465197ac74b1c0019009c26c5a802df238a17500efaa658fc4e37e9e..dacd4dc0b1f8b589c8d7538a373eba969835d81b6e9f87940b2f6cd480e6886d 100755 (executable)
@@ -3561,12 +3561,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);
This page took 0.2574 seconds and 4 git commands to generate.