aboutsummaryrefslogtreecommitdiff
path: root/archival/tar.c
diff options
context:
space:
mode:
authorGravatar Denys Vlasenko <vda.linux@googlemail.com>2011-02-06 20:01:11 +0100
committerGravatar Denys Vlasenko <vda.linux@googlemail.com>2011-02-06 20:01:11 +0100
commitaef441cb4d567da5575c498141b21eb38dc3fdaf (patch)
treef99a2ebecd77c614f243c4df859ee40f7281f9bc /archival/tar.c
parentca18e25525267736e7e919987c50569f27d70d36 (diff)
downloadbusybox-aef441cb4d567da5575c498141b21eb38dc3fdaf.tar.gz
busybox-aef441cb4d567da5575c498141b21eb38dc3fdaf.tar.bz2
tar: fix a bug where autodetection messes up -z on extract
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'archival/tar.c')
-rw-r--r--archival/tar.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/archival/tar.c b/archival/tar.c
index e9dc41fe1..1e3cecf44 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -1060,8 +1060,10 @@ int tar_main(int argc UNUSED_PARAM, char **argv)
tar_handle->src_fd = tar_fd;
tar_handle->seek = seek_by_read;
} else {
- if (ENABLE_FEATURE_TAR_AUTODETECT && flags == O_RDONLY) {
- get_header_ptr = get_header_tar;
+ if (ENABLE_FEATURE_TAR_AUTODETECT
+ && flags == O_RDONLY
+ && get_header_ptr == get_header_tar
+ ) {
tar_handle->src_fd = open_zipped(tar_filename);
if (tar_handle->src_fd < 0)
bb_perror_msg_and_die("can't open '%s'", tar_filename);