aboutsummaryrefslogtreecommitdiff
path: root/archival/gzip.c
diff options
context:
space:
mode:
authorMatheus Izvekov <mizvekov@gmail.com>2010-01-06 08:54:49 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2010-01-06 08:54:49 +0100
commit839fd71077d457c9e86afc56ba5cc54a0e1fcfb8 (patch)
tree51b8111117dea3718156c318fcf3c6f9c3acdfc6 /archival/gzip.c
parent251912443ce1dade4e6e457e47b4be6d274302ce (diff)
downloadbusybox-w32-839fd71077d457c9e86afc56ba5cc54a0e1fcfb8.tar.gz
busybox-w32-839fd71077d457c9e86afc56ba5cc54a0e1fcfb8.tar.bz2
busybox-w32-839fd71077d457c9e86afc56ba5cc54a0e1fcfb8.zip
gzip: add optional support for --long-opts
Signed-off-by: Matheus Izvekov <mizvekov@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to '')
-rw-r--r--archival/gzip.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/archival/gzip.c b/archival/gzip.c
index 71505698c..139eaacea 100644
--- a/archival/gzip.c
+++ b/archival/gzip.c
@@ -2043,6 +2043,23 @@ IF_DESKTOP(long long) int pack_gzip(unpack_info_t *info UNUSED_PARAM)
2043 return 0; 2043 return 0;
2044} 2044}
2045 2045
2046#if ENABLE_FEATURE_GZIP_LONG_OPTIONS
2047static const char gzip_longopts[] ALIGN1 =
2048 "stdout\0" No_argument "c"
2049 "to-stdout\0" No_argument "c"
2050 "force\0" No_argument "f"
2051 "verbose\0" No_argument "v"
2052#if ENABLE_GUNZIP
2053 "decompress\0" No_argument "d"
2054 "uncompress\0" No_argument "d"
2055 "test\0" No_argument "t"
2056#endif
2057 "quiet\0" No_argument "q"
2058 "fast\0" No_argument "1"
2059 "best\0" No_argument "9"
2060 ;
2061#endif
2062
2046/* 2063/*
2047 * Linux kernel build uses gzip -d -n. We accept and ignore it. 2064 * Linux kernel build uses gzip -d -n. We accept and ignore it.
2048 * Man page says: 2065 * Man page says:
@@ -2066,6 +2083,9 @@ int gzip_main(int argc UNUSED_PARAM, char **argv)
2066{ 2083{
2067 unsigned opt; 2084 unsigned opt;
2068 2085
2086#if ENABLE_FEATURE_GZIP_LONG_OPTIONS
2087 applet_long_options = gzip_longopts;
2088#endif
2069 /* Must match bbunzip's constants OPT_STDOUT, OPT_FORCE! */ 2089 /* Must match bbunzip's constants OPT_STDOUT, OPT_FORCE! */
2070 opt = getopt32(argv, "cfv" IF_GUNZIP("dt") "q123456789n"); 2090 opt = getopt32(argv, "cfv" IF_GUNZIP("dt") "q123456789n");
2071#if ENABLE_GUNZIP /* gunzip_main may not be visible... */ 2091#if ENABLE_GUNZIP /* gunzip_main may not be visible... */
@@ -2080,7 +2100,6 @@ int gzip_main(int argc UNUSED_PARAM, char **argv)
2080 2100
2081 SET_PTR_TO_GLOBALS((char *)xzalloc(sizeof(struct globals)+sizeof(struct globals2)) 2101 SET_PTR_TO_GLOBALS((char *)xzalloc(sizeof(struct globals)+sizeof(struct globals2))
2082 + sizeof(struct globals)); 2102 + sizeof(struct globals));
2083 barrier();
2084 2103
2085 /* Allocate all global buffers (for DYN_ALLOC option) */ 2104 /* Allocate all global buffers (for DYN_ALLOC option) */
2086 ALLOC(uch, G1.l_buf, INBUFSIZ); 2105 ALLOC(uch, G1.l_buf, INBUFSIZ);