From 044228d5ecb9b79397f9fc915d046cf4538281e2 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Tue, 17 Jul 2001 01:12:36 +0000 Subject: This is vodz' latest patch. Sorry it took so long... 1) ping cleanup (compile fix from this patch already applied). 2) traceroute call not spare ntohl() now (and reduce size); 3) Fix for functions not declared static in insmod, ash, vi and mount. 4) a more simple API cmdedit :)) 5) adds "stopped jobs" warning to ash on Ctrl-D and fixes "ignoreeof" option 6) reduce exporting library function index->strchr (traceroute), bzero->memset (syslogd) --- archival/libunarchive/decompress_unzip.c | 16 ++++++---------- archival/libunarchive/unzip.c | 16 ++++++---------- 2 files changed, 12 insertions(+), 20 deletions(-) (limited to 'archival/libunarchive') diff --git a/archival/libunarchive/decompress_unzip.c b/archival/libunarchive/decompress_unzip.c index 359957196..ee746216d 100644 --- a/archival/libunarchive/decompress_unzip.c +++ b/archival/libunarchive/decompress_unzip.c @@ -67,7 +67,7 @@ static char *license_msg[] = { #include #include "libbb.h" -FILE *in_file, *out_file; +static FILE *in_file, *out_file; /* these are freed by gz_close */ static unsigned char *window; @@ -91,9 +91,9 @@ static const int N_MAX = 288; /* maximum number of codes in any set */ static long bytes_out; /* number of output bytes */ static unsigned long outcnt; /* bytes in output buffer */ -unsigned hufts; /* track memory usage */ -unsigned long bb; /* bit buffer */ -unsigned bk; /* bits in bit buffer */ +static unsigned hufts; /* track memory usage */ +static unsigned long bb; /* bit buffer */ +static unsigned bk; /* bits in bit buffer */ typedef struct huft_s { unsigned char e; /* number of extra bits or operation */ @@ -104,7 +104,7 @@ typedef struct huft_s { } v; } huft_t; -unsigned short mask_bits[] = { +static const unsigned short mask_bits[] = { 0x0000, 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff @@ -154,7 +154,7 @@ static void make_crc_table() * Write the output window window[0..outcnt-1] and update crc and bytes_out. * (Used for the decompressed data only.) */ -void flush_window() +static void flush_window(void) { int n; @@ -1021,10 +1021,6 @@ extern void gz_close(int gunzip_pid) if (waitpid(gunzip_pid, NULL, 0) == -1) { printf("Couldnt wait ?"); } - if (window) { free(window); - } - if (crc_table) { free(crc_table); - } } diff --git a/archival/libunarchive/unzip.c b/archival/libunarchive/unzip.c index 359957196..ee746216d 100644 --- a/archival/libunarchive/unzip.c +++ b/archival/libunarchive/unzip.c @@ -67,7 +67,7 @@ static char *license_msg[] = { #include #include "libbb.h" -FILE *in_file, *out_file; +static FILE *in_file, *out_file; /* these are freed by gz_close */ static unsigned char *window; @@ -91,9 +91,9 @@ static const int N_MAX = 288; /* maximum number of codes in any set */ static long bytes_out; /* number of output bytes */ static unsigned long outcnt; /* bytes in output buffer */ -unsigned hufts; /* track memory usage */ -unsigned long bb; /* bit buffer */ -unsigned bk; /* bits in bit buffer */ +static unsigned hufts; /* track memory usage */ +static unsigned long bb; /* bit buffer */ +static unsigned bk; /* bits in bit buffer */ typedef struct huft_s { unsigned char e; /* number of extra bits or operation */ @@ -104,7 +104,7 @@ typedef struct huft_s { } v; } huft_t; -unsigned short mask_bits[] = { +static const unsigned short mask_bits[] = { 0x0000, 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff @@ -154,7 +154,7 @@ static void make_crc_table() * Write the output window window[0..outcnt-1] and update crc and bytes_out. * (Used for the decompressed data only.) */ -void flush_window() +static void flush_window(void) { int n; @@ -1021,10 +1021,6 @@ extern void gz_close(int gunzip_pid) if (waitpid(gunzip_pid, NULL, 0) == -1) { printf("Couldnt wait ?"); } - if (window) { free(window); - } - if (crc_table) { free(crc_table); - } } -- cgit v1.2.3