Code

gitweb: fix use of uninitialized value.
authorJunio C Hamano <junkio@cox.net>
Tue, 1 Aug 2006 02:24:37 +0000 (19:24 -0700)
committerJunio C Hamano <junkio@cox.net>
Tue, 1 Aug 2006 02:24:37 +0000 (19:24 -0700)
Signed-off-by: Junio C Hamano <junkio@cox.net>
gitweb/gitweb.cgi

index 902b96a914c9e571289924bcef02def2e7d77f3e..f65b5d5ce2b53250bc34ad6dba311b873b5d29e0 100755 (executable)
@@ -779,9 +779,11 @@ sub mimetype_guess_file {
        open(MIME, $mimemap) or return undef;
        while (<MIME>) {
                my ($mime, $exts) = split(/\t+/);
-               my @exts = split(/\s+/, $exts);
-               foreach my $ext (@exts) {
-                       $mimemap{$ext} = $mime;
+               if (defined $exts) {
+                       my @exts = split(/\s+/, $exts);
+                       foreach my $ext (@exts) {
+                               $mimemap{$ext} = $mime;
+                       }
                }
        }
        close(MIME);