preparatory cleanups for seamless uncompression improvements

unpack_gz_stream_with_info: fix buggy error check
man: fix possible accesses past the end of a string
move seamless uncompression helpers from read_printf.c to open_transformer.c

function                                             old     new   delta
show_manpage                                         153     212     +59
unpack_gz_stream_with_info                           520     539     +19

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2012-03-06 16:23:50 +01:00
parent 17eedcad94
commit 59655077c5
6 changed files with 187 additions and 179 deletions

View File

@@ -713,6 +713,14 @@ extern void *xmalloc_read(int fd, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC;
extern void *xmalloc_open_read_close(const char *filename, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC;
/* Never returns NULL */
extern void *xmalloc_xopen_read_close(const char *filename, size_t *maxsz_p) FAST_FUNC RETURNS_MALLOC;
#define SEAMLESS_COMPRESSION (0 \
|| ENABLE_FEATURE_SEAMLESS_XZ \
|| ENABLE_FEATURE_SEAMLESS_LZMA \
|| ENABLE_FEATURE_SEAMLESS_BZ2 \
|| ENABLE_FEATURE_SEAMLESS_GZ \
|| ENABLE_FEATURE_SEAMLESS_Z)
/* Autodetects gzip/bzip2 formats. fd may be in the middle of the file! */
#if ENABLE_FEATURE_SEAMLESS_LZMA \
|| ENABLE_FEATURE_SEAMLESS_BZ2 \