diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2011-02-06 20:01:11 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2011-02-06 20:01:11 +0100 |
commit | aef441cb4d567da5575c498141b21eb38dc3fdaf (patch) | |
tree | f99a2ebecd77c614f243c4df859ee40f7281f9bc /archival/tar.c | |
parent | ca18e25525267736e7e919987c50569f27d70d36 (diff) | |
download | busybox-w32-aef441cb4d567da5575c498141b21eb38dc3fdaf.tar.gz busybox-w32-aef441cb4d567da5575c498141b21eb38dc3fdaf.tar.bz2 busybox-w32-aef441cb4d567da5575c498141b21eb38dc3fdaf.zip |
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.c | 6 |
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) | |||
1060 | tar_handle->src_fd = tar_fd; | 1060 | tar_handle->src_fd = tar_fd; |
1061 | tar_handle->seek = seek_by_read; | 1061 | tar_handle->seek = seek_by_read; |
1062 | } else { | 1062 | } else { |
1063 | if (ENABLE_FEATURE_TAR_AUTODETECT && flags == O_RDONLY) { | 1063 | if (ENABLE_FEATURE_TAR_AUTODETECT |
1064 | get_header_ptr = get_header_tar; | 1064 | && flags == O_RDONLY |
1065 | && get_header_ptr == get_header_tar | ||
1066 | ) { | ||
1065 | tar_handle->src_fd = open_zipped(tar_filename); | 1067 | tar_handle->src_fd = open_zipped(tar_filename); |
1066 | if (tar_handle->src_fd < 0) | 1068 | if (tar_handle->src_fd < 0) |
1067 | bb_perror_msg_and_die("can't open '%s'", tar_filename); | 1069 | bb_perror_msg_and_die("can't open '%s'", tar_filename); |