diff options
Diffstat (limited to 'libbb/read_printf.c')
-rw-r--r-- | libbb/read_printf.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/libbb/read_printf.c b/libbb/read_printf.c index 53f528f5a..1b215f97a 100644 --- a/libbb/read_printf.c +++ b/libbb/read_printf.c | |||
@@ -265,7 +265,7 @@ void FAST_FUNC setup_unzip_on_fd(int fd /*, int fail_if_not_detected*/) | |||
265 | 265 | ||
266 | /* .gz and .bz2 both have 2-byte signature, and their | 266 | /* .gz and .bz2 both have 2-byte signature, and their |
267 | * unpack_XXX_stream wants this header skipped. */ | 267 | * unpack_XXX_stream wants this header skipped. */ |
268 | xread(fd, magic.b16, sizeof(magic.b16)); | 268 | xread(fd, magic.b16, sizeof(magic.b16[0])); |
269 | if (ENABLE_FEATURE_SEAMLESS_GZ | 269 | if (ENABLE_FEATURE_SEAMLESS_GZ |
270 | && magic.b16[0] == GZIP_MAGIC | 270 | && magic.b16[0] == GZIP_MAGIC |
271 | ) { | 271 | ) { |
@@ -289,15 +289,13 @@ void FAST_FUNC setup_unzip_on_fd(int fd /*, int fail_if_not_detected*/) | |||
289 | if (ENABLE_FEATURE_SEAMLESS_XZ | 289 | if (ENABLE_FEATURE_SEAMLESS_XZ |
290 | && magic.b16[0] == XZ_MAGIC1 | 290 | && magic.b16[0] == XZ_MAGIC1 |
291 | ) { | 291 | ) { |
292 | /* .xz signature: 0xfd, '7', 'z', 'X', 'Z', 0x00 */ | ||
293 | /* More info at: http://tukaani.org/xz/xz-file-format.txt */ | ||
294 | offset = -6; | 292 | offset = -6; |
295 | xread(fd, magic.b32, sizeof(magic.b32)); | 293 | xread(fd, magic.b32, sizeof(magic.b32[0])); |
296 | if (magic.b32[0] == XZ_MAGIC2) { | 294 | if (magic.b32[0] == XZ_MAGIC2) { |
297 | # if BB_MMU | 295 | # if BB_MMU |
298 | xformer = unpack_xz_stream; | 296 | xformer = unpack_xz_stream; |
299 | /* unpack_xz_stream wants fd at position 0 */ | 297 | /* unpack_xz_stream wants fd at position 6, no need to seek */ |
300 | xlseek(fd, offset, SEEK_CUR); | 298 | //xlseek(fd, offset, SEEK_CUR); |
301 | # else | 299 | # else |
302 | xformer_prog = "unxz"; | 300 | xformer_prog = "unxz"; |
303 | # endif | 301 | # endif |