This changeset fixes an issue with empty compressed files, i.e.
files that after inflating are of size 0: bsdcat would report
unrecognized archive format for those because the raw reader is
unable to handle files of zero length.
This changeset will refuse to extract WARCs that contain filenames
a la http://example.com/implicit/content/
There is a todo note in archive_read_support_format_warc.c discussing
possible archive options to extract filenames like those either by
explicit user input or by some sort of heuristic as used in wget
for example.
This changeset adheres to the previously imported read test.
The archive format is hard-set to ARCHIVE_FORMAT_WARC, while the
format name is the stringified WARC/x.y version designator, which
for performance reasons will be cached between calls to the header
reader _warc_rdhdr().
in _warc_read(). Also kick __archive_read_consume() because the writer
will consume the bytes for us. So for the EOF case, set unconsumed to 0,
for the non-EOF case set unconsumed to the minimum of the number of bytes
read and the content length.
Heeding Tim's advice, a non-NULL from __archive_read_ahead() is
guaranteed to be of at least the minimum size, therefore no need to
check for this condition again.
previously announce in _warc_header().
The test suite (as is) is one offender. It populates a 9-byte string, mimicking an IFREG file
but by the time the header makes it into the archive, the size changes from 0 to 9.