diff options
Diffstat (limited to 'archival/tar.c')
-rw-r--r-- | archival/tar.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/archival/tar.c b/archival/tar.c index 1c71f7f66..6950c271d 100644 --- a/archival/tar.c +++ b/archival/tar.c | |||
@@ -1162,8 +1162,16 @@ int tar_main(int argc UNUSED_PARAM, char **argv) | |||
1162 | tar_handle->seek = seek_by_read; | 1162 | tar_handle->seek = seek_by_read; |
1163 | } else | 1163 | } else |
1164 | if (ENABLE_FEATURE_TAR_AUTODETECT | 1164 | if (ENABLE_FEATURE_TAR_AUTODETECT |
1165 | && ENABLE_FEATURE_SEAMLESS_LZMA | ||
1165 | && flags == O_RDONLY | 1166 | && flags == O_RDONLY |
1166 | && !(opt & OPT_ANY_COMPRESS) | 1167 | && !(opt & OPT_ANY_COMPRESS) |
1168 | && is_suffixed_with(tar_filename, ".lzma") | ||
1169 | /* We do this only for .lzma files, they have no signature. | ||
1170 | * All other compression formats are recognized in | ||
1171 | * get_header_tar() when first tar block has invalid format. | ||
1172 | * Doing it here for all filenames would falsely trigger | ||
1173 | * on e.g. tarball with 1st file named "BZh5". | ||
1174 | */ | ||
1167 | ) { | 1175 | ) { |
1168 | tar_handle->src_fd = open_zipped(tar_filename, /*fail_if_not_compressed:*/ 0); | 1176 | tar_handle->src_fd = open_zipped(tar_filename, /*fail_if_not_compressed:*/ 0); |
1169 | if (tar_handle->src_fd < 0) | 1177 | if (tar_handle->src_fd < 0) |