aboutsummaryrefslogtreecommitdiff
path: root/archival/tar.c
diff options
context:
space:
mode:
Diffstat (limited to 'archival/tar.c')
-rw-r--r--archival/tar.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/archival/tar.c b/archival/tar.c
index 9a171ceea..22ad0e0f2 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -1197,8 +1197,16 @@ int tar_main(int argc UNUSED_PARAM, char **argv)
1197 tar_handle->seek = seek_by_read; 1197 tar_handle->seek = seek_by_read;
1198 } else 1198 } else
1199 if (ENABLE_FEATURE_TAR_AUTODETECT 1199 if (ENABLE_FEATURE_TAR_AUTODETECT
1200 && ENABLE_FEATURE_SEAMLESS_LZMA
1200 && flags == O_RDONLY 1201 && flags == O_RDONLY
1201 && !(opt & OPT_ANY_COMPRESS) 1202 && !(opt & OPT_ANY_COMPRESS)
1203 && is_suffixed_with(tar_filename, ".lzma")
1204 /* We do this only for .lzma files, they have no signature.
1205 * All other compression formats are recognized in
1206 * get_header_tar() when first tar block has invalid format.
1207 * Doing it here for all filenames would falsely trigger
1208 * on e.g. tarball with 1st file named "BZh5".
1209 */
1202 ) { 1210 ) {
1203 tar_handle->src_fd = open_zipped(tar_filename, /*fail_if_not_compressed:*/ 0); 1211 tar_handle->src_fd = open_zipped(tar_filename, /*fail_if_not_compressed:*/ 0);
1204 if (tar_handle->src_fd < 0) 1212 if (tar_handle->src_fd < 0)