]> Sergey Matveev's repositories - public-inbox.git/commitdiff
mboxgz: fix compiler parse error under under Perl 5.16.3
authorEric Wong <e@80x24.org>
Sun, 24 Nov 2019 03:19:42 +0000 (03:19 +0000)
committerEric Wong <e@80x24.org>
Sun, 24 Nov 2019 21:23:31 +0000 (21:23 +0000)
Perl 5.16.3 (and possibly older versions) fails with the
following errors (from CentOS7):

  Use of ?PATTERN? without explicit operator is deprecated
  Search pattern not terminated

lib/PublicInbox/MboxGz.pm

index 2a55447f84e873b7fedb0db4b969128856c7eb5a..1621cff8f3f99511fa20ff91469fdc14e32126d6 100644 (file)
@@ -63,7 +63,7 @@ sub getline {
        # signal that we're done and can return undef next call:
        delete $self->{ctx};
        my $err = $gz->flush($buf, Z_FINISH);
-       $err == Z_OK ? $buf : gzip_fail($ctx, $err);
+       ($err == Z_OK) ? $buf : gzip_fail($ctx, $err);
 }
 
 sub close {} # noop