aboutsummaryrefslogtreecommitdiff
path: root/archival/bbunzip.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-05-27 02:22:54 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2010-05-27 02:22:54 +0200
commitccb88a689e0f603f8d94255a7d9cb8128b6e620d (patch)
treeebd35745219fbb246b605826a147e6ec031d891e /archival/bbunzip.c
parentc5f30c0df8f0ce5e94ca22a5100496233067708a (diff)
downloadbusybox-w32-ccb88a689e0f603f8d94255a7d9cb8128b6e620d.tar.gz
busybox-w32-ccb88a689e0f603f8d94255a7d9cb8128b6e620d.tar.bz2
busybox-w32-ccb88a689e0f603f8d94255a7d9cb8128b6e620d.zip
unlzma: add "lzma -d" alias, add -t support, rename lzmacat->lzcat
Also coalesce some common strings text data bss dec hex filename 844110 453 6812 851375 cfdaf busybox_old 844061 453 6812 851326 cfd7e busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'archival/bbunzip.c')
-rw-r--r--archival/bbunzip.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/archival/bbunzip.c b/archival/bbunzip.c
index df674bc6c..1e775f425 100644
--- a/archival/bbunzip.c
+++ b/archival/bbunzip.c
@@ -9,12 +9,12 @@
9#include "unarchive.h" 9#include "unarchive.h"
10 10
11enum { 11enum {
12 OPT_STDOUT = 0x1, 12 OPT_STDOUT = 1 << 0,
13 OPT_FORCE = 0x2, 13 OPT_FORCE = 1 << 1,
14/* gunzip and bunzip2 only: */ 14 /* only some decompressors: */
15 OPT_VERBOSE = 0x4, 15 OPT_VERBOSE = 1 << 2,
16 OPT_DECOMPRESS = 0x8, 16 OPT_DECOMPRESS = 1 << 3,
17 OPT_TEST = 0x10, 17 OPT_TEST = 1 << 4,
18}; 18};
19 19
20static 20static
@@ -333,12 +333,17 @@ IF_DESKTOP(long long) int unpack_unlzma(unpack_info_t *info UNUSED_PARAM)
333int unlzma_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 333int unlzma_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
334int unlzma_main(int argc UNUSED_PARAM, char **argv) 334int unlzma_main(int argc UNUSED_PARAM, char **argv)
335{ 335{
336 getopt32(argv, "cf"); 336 int opts = getopt32(argv, "cfvdt");
337 argv += optind; 337# if ENABLE_FEATURE_LZMA_ALIAS
338 /* lzmacat? */ 338 /* lzma without -d or -t? */
339 if (applet_name[4] == 'c') 339 if (applet_name[2] == 'm' && !(opts & (OPT_DECOMPRESS|OPT_TEST)))
340 bb_show_usage();
341# endif
342 /* lzcat? */
343 if (applet_name[2] == 'c')
340 option_mask32 |= OPT_STDOUT; 344 option_mask32 |= OPT_STDOUT;
341 345
346 argv += optind;
342 return bbunpack(argv, make_new_name_unlzma, unpack_unlzma); 347 return bbunpack(argv, make_new_name_unlzma, unpack_unlzma);
343} 348}
344 349
@@ -346,7 +351,7 @@ int unlzma_main(int argc UNUSED_PARAM, char **argv)
346 351
347 352
348/* 353/*
349 * Uncompress applet for busybox (c) 2002 Glenn McGrath 354 * Uncompress applet for busybox (c) 2002 Glenn McGrath
350 * 355 *
351 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 356 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
352 */ 357 */