svn commit: trunk/busybox/archival

vda at busybox.net vda at busybox.net
Fri Jun 27 21:52:41 UTC 2008


Author: vda
Date: 2008-06-27 14:52:41 -0700 (Fri, 27 Jun 2008)
New Revision: 22540

Log:
support gzip -t and bzip2 -t



Modified:
   trunk/busybox/archival/bzip2.c
   trunk/busybox/archival/gzip.c


Changeset:
Modified: trunk/busybox/archival/bzip2.c
===================================================================
--- trunk/busybox/archival/bzip2.c	2008-06-27 21:24:08 UTC (rev 22539)
+++ trunk/busybox/archival/bzip2.c	2008-06-27 21:52:41 UTC (rev 22540)
@@ -162,11 +162,11 @@
 
 	opt_complementary = "s2"; /* -s means -2 (compatibility) */
 	/* Must match bbunzip's constants OPT_STDOUT, OPT_FORCE! */
-	opt = getopt32(argv, "cfv" USE_BUNZIP2("d") "123456789qzs" );
+	opt = getopt32(argv, "cfv" USE_BUNZIP2("dt") "123456789qzs");
 #if ENABLE_BUNZIP2 /* bunzip2_main may not be visible... */
-	if (opt & 0x8) // -d
+	if (opt & 0x18) // -d and/or -t
 		return bunzip2_main(argc, argv);
-	opt >>= 4;
+	opt >>= 5;
 #else
 	opt >>= 3;
 #endif

Modified: trunk/busybox/archival/gzip.c
===================================================================
--- trunk/busybox/archival/gzip.c	2008-06-27 21:24:08 UTC (rev 22539)
+++ trunk/busybox/archival/gzip.c	2008-06-27 21:52:41 UTC (rev 22540)
@@ -2049,9 +2049,9 @@
 	unsigned opt;
 
 	/* Must match bbunzip's constants OPT_STDOUT, OPT_FORCE! */
-	opt = getopt32(argv, "cfv" USE_GUNZIP("d") "q123456789n" );
+	opt = getopt32(argv, "cfv" USE_GUNZIP("dt") "q123456789n");
 #if ENABLE_GUNZIP /* gunzip_main may not be visible... */
-	if (opt & 0x8) // -d
+	if (opt & 0x18) // -d and/or -t
 		return gunzip_main(argc, argv);
 #endif
 	option_mask32 &= 0x7; /* ignore -q, -0..9 */
@@ -2062,6 +2062,7 @@
 
 	SET_PTR_TO_GLOBALS(xzalloc(sizeof(struct globals) + sizeof(struct globals2))
 			+ sizeof(struct globals));
+	barrier();
 	G2.l_desc.dyn_tree    = G2.dyn_ltree;
 	G2.l_desc.static_tree = G2.static_ltree;
 	G2.l_desc.extra_bits  = extra_lbits;




More information about the busybox-cvs mailing list