FileFd(): Drop file name extension check in ReadOnlyGzip mode
authormartin@piware.de <>
Tue, 6 Jul 2010 10:48:06 +0000 (12:48 +0200)
committermartin@piware.de <>
Tue, 6 Jul 2010 10:48:06 +0000 (12:48 +0200)
commitd13c2d3f7b10e558301a05948e91ac4a60160793
tree7252f169a95fc475bad8f3799dc8f7d2112e6768
parent9a3a552a2859040ffc587a4e5d8d96311038e680
FileFd(): Drop file name extension check in ReadOnlyGzip mode

Drop the ".gz" extension check in FileFd::Open() in ReadOnlyGzip mode, to not
depend on a particular file extension. This allows rewriting the gzip method
using internal decompression (on ".decomp" files).

This requires a zlib bug workaround in FileFd::Close(): When opening an empty
file with gzdopen(), gzclose() fails with Z_BUF_ERROR. Do not count this as a
failure.
apt-pkg/contrib/fileutl.cc