gz_open and gz_close were left in, even when BB_FEATURE_TAR_GZIP was disabled.
[oweals/busybox.git] / gunzip.c
index d457b750cae50b2bfe6f7beb747a92762c4a0351..51541f15553ed8b66029b660d7786800c3782009 100644 (file)
--- a/gunzip.c
+++ b/gunzip.c
@@ -1017,6 +1017,7 @@ extern int unzip(FILE *l_in_file, FILE *l_out_file)
        return 0;
 }
 
+#ifdef BB_FEATURE_TAR_GZIP
 extern int gz_open(FILE *compressed_file, int *pid)
 {
        int unzip_pipe[2];
@@ -1056,6 +1057,7 @@ extern void gz_close(int gunzip_pid)
        free(window);
        free(crc_table);
 }
+#endif 
 
 extern int gunzip_main(int argc, char **argv)
 {
@@ -1074,16 +1076,14 @@ extern int gunzip_main(int argc, char **argv)
        int opt = 0;
        int delete_old_file = FALSE;
 
-#ifdef BB_ZCAT
        /* if called as zcat */
        if (strcmp(applet_name, "zcat") == 0) {
                if (argc != 2) {
                        show_usage();
                }
+               optind = 1;
                flags |= (gunzip_force | gunzip_to_stdout);
-       } else
-#endif
-       if (strcmp(applet_name, "gunzip") == 0) {
+       } else {
                /* workout flags as regular gunzip */
                /* set default flags */
                if (argc == 1) {