]> Sergey Matveev's repositories - public-inbox.git/commitdiff
viewvcs: allow '0' as a valid filename for blob downloads
authorEric Wong <e@80x24.org>
Fri, 1 Feb 2019 06:06:04 +0000 (06:06 +0000)
committerEric Wong <e@80x24.org>
Fri, 1 Feb 2019 06:06:35 +0000 (06:06 +0000)
Only to be pedantic...

lib/PublicInbox/ViewVCS.pm

index eecc51e673b2aad8ad8fbfbca21326ed895be7b6..d67b5eb41dc20e455a74d4a6b7472d37b285e2bf 100644 (file)
@@ -110,7 +110,7 @@ sub solve_result {
        }
 
        my $binary = index($$blob, "\0") >= 0;
-       if ($fn) {
+       if (defined $fn) {
                my $h = [ 'Content-Length', $size, 'Content-Type' ];
                push(@$h, ($binary ? 'application/octet-stream' : 'text/plain'));
                return delete($ctx->{-wcb})->([200, $h, [ $$blob ]]);