aboutsummaryrefslogtreecommitdiff
path: root/archival/gzip.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-03-30 13:11:47 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-03-30 13:11:47 +0000
commit5297809c03271977cc1187b82dd1756684edf93a (patch)
treea9a702075041efeb4e976e09b8387f30b4703e0a /archival/gzip.c
parent1b2058fe986a183d6b2f71145b166d683df82770 (diff)
downloadbusybox-5297809c03271977cc1187b82dd1756684edf93a.tar.gz
g[un]zip: accept and ignore -n (needed for kernel compile)
Diffstat (limited to 'archival/gzip.c')
-rw-r--r--archival/gzip.c16
1 files changed, 15 insertions, 1 deletions
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)
return 0;
}
+/*
+ * Linux kernel build uses gzip -d -n. We accept and ignore it.
+ * Man page says:
+ * -n --no-name
+ * gzip: do not save the original file name and time stamp.
+ * (The original name is always saved if the name had to be truncated.)
+ * gunzip: do not restore the original file name/time even if present
+ * (remove only the gzip suffix from the compressed file name).
+ * This option is the default when decompressing.
+ * -N --name
+ * gzip: always save the original file name and time stamp (this is the default)
+ * gunzip: restore the original file name and time stamp if present.
+ */
+
int gzip_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
#if ENABLE_GUNZIP
int gzip_main(int argc, char **argv)
@@ -2035,7 +2049,7 @@ int gzip_main(int argc ATTRIBUTE_UNUSED, char **argv)
unsigned opt;
/* Must match bbunzip's constants OPT_STDOUT, OPT_FORCE! */
- opt = getopt32(argv, "cfv" USE_GUNZIP("d") "q123456789" );
+ opt = getopt32(argv, "cfv" USE_GUNZIP("d") "q123456789n" );
#if ENABLE_GUNZIP /* gunzip_main may not be visible... */
if (opt & 0x8) // -d
return gunzip_main(argc, argv);