diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-03-30 13:11:47 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-03-30 13:11:47 +0000 |
commit | 5297809c03271977cc1187b82dd1756684edf93a (patch) | |
tree | a9a702075041efeb4e976e09b8387f30b4703e0a | |
parent | 1b2058fe986a183d6b2f71145b166d683df82770 (diff) | |
download | busybox-w32-5297809c03271977cc1187b82dd1756684edf93a.tar.gz busybox-w32-5297809c03271977cc1187b82dd1756684edf93a.tar.bz2 busybox-w32-5297809c03271977cc1187b82dd1756684edf93a.zip |
g[un]zip: accept and ignore -n (needed for kernel compile)
-rw-r--r-- | archival/bbunzip.c | 16 | ||||
-rw-r--r-- | archival/gzip.c | 16 |
2 files changed, 30 insertions, 2 deletions
diff --git a/archival/bbunzip.c b/archival/bbunzip.c index 327b3cf2c..90d39f682 100644 --- a/archival/bbunzip.c +++ b/archival/bbunzip.c | |||
@@ -256,10 +256,24 @@ USE_DESKTOP(long long) int unpack_gunzip(void) | |||
256 | return status; | 256 | return status; |
257 | } | 257 | } |
258 | 258 | ||
259 | /* | ||
260 | * Linux kernel build uses gzip -d -n. We accept and ignore it. | ||
261 | * Man page says: | ||
262 | * -n --no-name | ||
263 | * gzip: do not save the original file name and time stamp. | ||
264 | * (The original name is always saved if the name had to be truncated.) | ||
265 | * gunzip: do not restore the original file name/time even if present | ||
266 | * (remove only the gzip suffix from the compressed file name). | ||
267 | * This option is the default when decompressing. | ||
268 | * -N --name | ||
269 | * gzip: always save the original file name and time stamp (this is the default) | ||
270 | * gunzip: restore the original file name and time stamp if present. | ||
271 | */ | ||
272 | |||
259 | int gunzip_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 273 | int gunzip_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
260 | int gunzip_main(int argc ATTRIBUTE_UNUSED, char **argv) | 274 | int gunzip_main(int argc ATTRIBUTE_UNUSED, char **argv) |
261 | { | 275 | { |
262 | getopt32(argv, "cfvdt"); | 276 | getopt32(argv, "cfvdtn"); |
263 | argv += optind; | 277 | argv += optind; |
264 | /* if called as zcat */ | 278 | /* if called as zcat */ |
265 | if (applet_name[1] == 'c') | 279 | if (applet_name[1] == 'c') |
diff --git a/archival/gzip.c b/archival/gzip.c index a96d02911..dce40ec92 100644 --- a/archival/gzip.c +++ b/archival/gzip.c | |||
@@ -2025,6 +2025,20 @@ USE_DESKTOP(long long) int pack_gzip(void) | |||
2025 | return 0; | 2025 | return 0; |
2026 | } | 2026 | } |
2027 | 2027 | ||
2028 | /* | ||
2029 | * Linux kernel build uses gzip -d -n. We accept and ignore it. | ||
2030 | * Man page says: | ||
2031 | * -n --no-name | ||
2032 | * gzip: do not save the original file name and time stamp. | ||
2033 | * (The original name is always saved if the name had to be truncated.) | ||
2034 | * gunzip: do not restore the original file name/time even if present | ||
2035 | * (remove only the gzip suffix from the compressed file name). | ||
2036 | * This option is the default when decompressing. | ||
2037 | * -N --name | ||
2038 | * gzip: always save the original file name and time stamp (this is the default) | ||
2039 | * gunzip: restore the original file name and time stamp if present. | ||
2040 | */ | ||
2041 | |||
2028 | int gzip_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 2042 | int gzip_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
2029 | #if ENABLE_GUNZIP | 2043 | #if ENABLE_GUNZIP |
2030 | int gzip_main(int argc, char **argv) | 2044 | int gzip_main(int argc, char **argv) |
@@ -2035,7 +2049,7 @@ int gzip_main(int argc ATTRIBUTE_UNUSED, char **argv) | |||
2035 | unsigned opt; | 2049 | unsigned opt; |
2036 | 2050 | ||
2037 | /* Must match bbunzip's constants OPT_STDOUT, OPT_FORCE! */ | 2051 | /* Must match bbunzip's constants OPT_STDOUT, OPT_FORCE! */ |
2038 | opt = getopt32(argv, "cfv" USE_GUNZIP("d") "q123456789" ); | 2052 | opt = getopt32(argv, "cfv" USE_GUNZIP("d") "q123456789n" ); |
2039 | #if ENABLE_GUNZIP /* gunzip_main may not be visible... */ | 2053 | #if ENABLE_GUNZIP /* gunzip_main may not be visible... */ |
2040 | if (opt & 0x8) // -d | 2054 | if (opt & 0x8) // -d |
2041 | return gunzip_main(argc, argv); | 2055 | return gunzip_main(argc, argv); |