aboutsummaryrefslogtreecommitdiff
path: root/archival/bbunzip.c
diff options
context:
space:
mode:
Diffstat (limited to 'archival/bbunzip.c')
-rw-r--r--archival/bbunzip.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/archival/bbunzip.c b/archival/bbunzip.c
index a859ef201..aaaf67e03 100644
--- a/archival/bbunzip.c
+++ b/archival/bbunzip.c
@@ -222,7 +222,7 @@ char* FAST_FUNC make_new_name_generic(char *filename, const char *expected_ext)
222 222
223//config:config UNCOMPRESS 223//config:config UNCOMPRESS
224//config: bool "uncompress" 224//config: bool "uncompress"
225//config: default n 225//config: default n # ancient
226//config: help 226//config: help
227//config: uncompress is used to decompress archives created by compress. 227//config: uncompress is used to decompress archives created by compress.
228//config: Not much used anymore, replaced by gzip/gunzip. 228//config: Not much used anymore, replaced by gzip/gunzip.
@@ -292,6 +292,13 @@ int uncompress_main(int argc UNUSED_PARAM, char **argv)
292//config: gunzip is used to decompress archives created by gzip. 292//config: gunzip is used to decompress archives created by gzip.
293//config: You can use the `-t' option to test the integrity of 293//config: You can use the `-t' option to test the integrity of
294//config: an archive, without decompressing it. 294//config: an archive, without decompressing it.
295//config:
296//config:config FEATURE_GUNZIP_LONG_OPTIONS
297//config: bool "Enable long options"
298//config: default y
299//config: depends on GUNZIP && LONG_OPTS
300//config: help
301//config: Enable use of long options.
295 302
296//applet:IF_GUNZIP(APPLET(gunzip, BB_DIR_BIN, BB_SUID_DROP)) 303//applet:IF_GUNZIP(APPLET(gunzip, BB_DIR_BIN, BB_SUID_DROP))
297//applet:IF_GUNZIP(APPLET_ODDNAME(zcat, gunzip, BB_DIR_BIN, BB_SUID_DROP, zcat)) 304//applet:IF_GUNZIP(APPLET_ODDNAME(zcat, gunzip, BB_DIR_BIN, BB_SUID_DROP, zcat))
@@ -323,6 +330,17 @@ char* FAST_FUNC make_new_name_gunzip(char *filename, const char *expected_ext UN
323 } 330 }
324 return filename; 331 return filename;
325} 332}
333
334#if ENABLE_FEATURE_GUNZIP_LONG_OPTIONS
335static const char gunzip_longopts[] ALIGN1 =
336 "stdout\0" No_argument "c"
337 "to-stdout\0" No_argument "c"
338 "force\0" No_argument "f"
339 "test\0" No_argument "t"
340 "no-name\0" No_argument "n"
341 ;
342#endif
343
326/* 344/*
327 * Linux kernel build uses gzip -d -n. We accept and ignore it. 345 * Linux kernel build uses gzip -d -n. We accept and ignore it.
328 * Man page says: 346 * Man page says:
@@ -339,6 +357,9 @@ char* FAST_FUNC make_new_name_gunzip(char *filename, const char *expected_ext UN
339int gunzip_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 357int gunzip_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
340int gunzip_main(int argc UNUSED_PARAM, char **argv) 358int gunzip_main(int argc UNUSED_PARAM, char **argv)
341{ 359{
360#if ENABLE_FEATURE_GUNZIP_LONG_OPTIONS
361 applet_long_options = gunzip_longopts;
362#endif
342 getopt32(argv, "cfvqdtn"); 363 getopt32(argv, "cfvqdtn");
343 argv += optind; 364 argv += optind;
344 365