diff options
author | Dan Fandrich <dan@coneharvesters.com> | 2017-03-23 21:11:41 +0100 |
---|---|---|
committer | Dan Fandrich <dan@coneharvesters.com> | 2017-03-23 21:11:41 +0100 |
commit | ae22034d0d711881b0cbf1e8be3090cad486bb97 (patch) | |
tree | 689da4fdf88eb62f10d3d68b0d2606fd0f3d1eb9 /src/mkhelp.pl | |
parent | f355a92cd5b117c71d8626efc1be280bb28037a2 (diff) | |
download | curl-ae22034d0d711881b0cbf1e8be3090cad486bb97.tar.gz |
mkhelp: disable compression if the perl gzip module is unavailable
This is nowadays included with the base perl distribution, but wasn't
prior to about perl 5.14
Diffstat (limited to 'src/mkhelp.pl')
-rw-r--r-- | src/mkhelp.pl | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/mkhelp.pl b/src/mkhelp.pl index 8b7f72157..4b540744c 100644 --- a/src/mkhelp.pl +++ b/src/mkhelp.pl @@ -113,8 +113,19 @@ print <<HEAD HEAD ; if($c) { - # if compressed - use IO::Compress::Gzip; + # If compression requested, check that the Gzip module is available + # or else disable compression + $c = eval + { + require IO::Compress::Gzip; + IO::Compress::Gzip->import(); + 1; + }; + print STDERR "Warning: compression requested but Gzip is not available\n" if (!$c) +} + +if($c) +{ my $content = join("", @out); my $gzippedContent; IO::Compress::Gzip::gzip( |