Credited Christophe Boyaniqu for interactive patch to rm.
[oweals/busybox.git] / gzip.c
diff --git a/gzip.c b/gzip.c
index 75f3caa359c0e080a8d5648a930667a8711c25cf..6c058d2b62a7768207133a6808c4db95da54fc6e 100644 (file)
--- a/gzip.c
+++ b/gzip.c
  *
  */
 
-#include "busybox.h"
-#define BB_DECLARE_EXTERN
-#define bb_need_memory_exhausted
-#include "messages.c"
-
 /* These defines are very important for BusyBox.  Without these,
  * huge chunks of ram are pre-allocated making the BusyBox bss 
  * size Freaking Huge(tm), which is a bad thing.*/
 /* I don't like nested includes, but the string and io functions are used
  * too often
  */
+#include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
+#include "busybox.h"
+#define BB_DECLARE_EXTERN
+#define bb_need_memory_exhausted
+#include "messages.c"
+
 #define memzero(s, n)     memset ((void *)(s), 0, (n))
 
 #ifndef RETSIGTYPE
@@ -1628,12 +1629,6 @@ ulg deflate()
 #  include <unistd.h>
 #endif
 
-#if defined(STDC_HEADERS) || !defined(NO_STDLIB_H)
-#  include <stdlib.h>
-#else
-extern int errno;
-#endif
-
 #if defined(DIRENT)
 #  include <dirent.h>
 typedef struct dirent dir_type;
@@ -1812,7 +1807,7 @@ int gzip_main(int argc, char **argv)
                        case 'd':
                                exit(gunzip_main(argc, argv));
                        default:
-                               usage(gzip_usage);
+                               show_usage();
                        }
                }
        }
@@ -1865,7 +1860,7 @@ int gzip_main(int argc, char **argv)
        } else {
                /* Open up the input file */
                if (argc <= 0)
-                       usage(gzip_usage);
+                       show_usage();
                strncpy(ifname, *argv, MAX_PATH_LEN);
 
                /* Open input file */
@@ -3098,12 +3093,6 @@ local void set_file_type()
 #  include <fcntl.h>
 #endif
 
-#if defined(STDC_HEADERS) || !defined(NO_STDLIB_H)
-#  include <stdlib.h>
-#else
-extern int errno;
-#endif
-
 /* ===========================================================================
  * Copy input to output unchanged: zcat == cat with --force.
  * IN assertion: insize bytes have already been read in inbuf.