Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.busybox.net/busybox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2018-11-27 13:26:48 +0300
committerDenys Vlasenko <vda.linux@googlemail.com>2018-11-27 13:26:48 +0300
commitf4fc303e3679e4ab0d45f60c31f9b687f27f7452 (patch)
treec270be417b97696e3a9897eab5602ce30faf313d /archival/libarchive
parent2d217799e8f23514ad3be6a951aa928c265bc6a4 (diff)
tar: fix too eager autodetection, closes 11531
function old new delta is_suffixed_with - 54 +54 tar_main 1006 1026 +20 open_transformer 92 79 -13 config_file_action 478 458 -20 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/2 up/down: 74/-33) Total: 41 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'archival/libarchive')
-rw-r--r--archival/libarchive/open_transformer.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/archival/libarchive/open_transformer.c b/archival/libarchive/open_transformer.c
index 9fefd4aad..4a4bf3916 100644
--- a/archival/libarchive/open_transformer.c
+++ b/archival/libarchive/open_transformer.c
@@ -278,8 +278,7 @@ static transformer_state_t *open_transformer(const char *fname, int fail_if_not_
if (ENABLE_FEATURE_SEAMLESS_LZMA) {
/* .lzma has no header/signature, can only detect it by extension */
- char *sfx = strrchr(fname, '.');
- if (sfx && strcmp(sfx+1, "lzma") == 0) {
+ if (is_suffixed_with(fname, ".lzma")) {
xstate = xzalloc(sizeof(*xstate));
xstate->src_fd = fd;
xstate->xformer = unpack_lzma_stream;