summaryrefslogtreecommitdiff
path: root/archival/unzip.c
diff options
context:
space:
mode:
authorDenys Vlasenko2017-01-09 11:12:01 +0100
committerDenys Vlasenko2017-01-09 11:12:01 +0100
commit6b4f4b52845d903f6e06f4dbca22ad0e2f67f473 (patch)
tree44b079e2aa3f6c4754af54b810d0029d2dc338f0 /archival/unzip.c
parent2a0867a5ed277e4c3cf4c5e17e539d225286ef07 (diff)
downloadbusybox-6b4f4b52845d903f6e06f4dbca22ad0e2f67f473.zip
busybox-6b4f4b52845d903f6e06f4dbca22ad0e2f67f473.tar.gz
unzip: optional support for xz
function old new delta unzip_main 2476 2491 +15 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'archival/unzip.c')
-rw-r--r--archival/unzip.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/archival/unzip.c b/archival/unzip.c
index 997543c..6dc5d89 100644
--- a/archival/unzip.c
+++ b/archival/unzip.c
@@ -46,6 +46,11 @@
//config: bool "Support compression method 14 (lzma)"
//config: default y
//config: depends on FEATURE_UNZIP_CDF && DESKTOP
+//config:
+//config:config FEATURE_UNZIP_XZ
+//config: bool "Support compression method 95 (xz)"
+//config: default y
+//config: depends on FEATURE_UNZIP_CDF && DESKTOP
//applet:IF_UNZIP(APPLET(unzip, BB_DIR_USR_BIN, BB_SUID_DROP))
//kbuild:lib-$(CONFIG_UNZIP) += unzip.o
@@ -372,6 +377,14 @@ static void unzip_extract(zip_header_t *zip, int dst_fd)
bb_error_msg_and_die("inflate error");
}
#endif
+#if ENABLE_FEATURE_UNZIP_XZ
+ else if (zip->fmt.method == 95) {
+ /* Not tested yet */
+ xstate.bytes_out = unpack_xz_stream(&xstate);
+ if (xstate.bytes_out < 0)
+ bb_error_msg_and_die("inflate error");
+ }
+#endif
else {
bb_error_msg_and_die("unsupported method %u", zip->fmt.method);
}