aboutsummaryrefslogtreecommitdiff
path: root/archival/gzip.c
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-11-14 02:44:28 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-11-14 02:44:28 +0000
commit51e936392ab7838be508a1c25ccd4c66287ad0ad (patch)
tree15554eacc8eb895405dd88cb499103eab492569f /archival/gzip.c
parentfbdef71a26dee26b1658027131c3f48768f441f3 (diff)
downloadbusybox-w32-51e936392ab7838be508a1c25ccd4c66287ad0ad.tar.gz
busybox-w32-51e936392ab7838be508a1c25ccd4c66287ad0ad.tar.bz2
busybox-w32-51e936392ab7838be508a1c25ccd4c66287ad0ad.zip
Vladimir N. Oleynik (vodz) writes:
Hi Glenn. I analysed BSS size gzip applet and found may be mistake: updcrc() checking if (crc_table_empty) but not resetted this var. This do make slow gzip applet ;-) --w vodz git-svn-id: svn://busybox.net/trunk/busybox@7901 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'archival/gzip.c')
-rw-r--r--archival/gzip.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/archival/gzip.c b/archival/gzip.c
index bc4c7badd..2be5603a0 100644
--- a/archival/gzip.c
+++ b/archival/gzip.c
@@ -305,8 +305,6 @@ DECLARE(ush, d_buf, DIST_BUFSIZE);
305DECLARE(uch, window, 2L * WSIZE); 305DECLARE(uch, window, 2L * WSIZE);
306DECLARE(ush, tab_prefix, 1L << BITS); 306DECLARE(ush, tab_prefix, 1L << BITS);
307 307
308static int crc_table_empty = 1;
309
310static int foreground; /* set if program run in foreground */ 308static int foreground; /* set if program run in foreground */
311static int method = DEFLATED; /* compression method */ 309static int method = DEFLATED; /* compression method */
312static int exit_code = OK; /* program exit code */ 310static int exit_code = OK; /* program exit code */
@@ -387,14 +385,13 @@ static ulg updcrc(uch * s, unsigned n)
387 register ulg c; /* temporary variable */ 385 register ulg c; /* temporary variable */
388 static unsigned long crc_32_tab[256]; 386 static unsigned long crc_32_tab[256];
389 387
390 if (crc_table_empty) { 388 if (crc_32_tab[1] == 0x00000000L) {
391 unsigned long csr; /* crc shift register */ 389 unsigned long csr; /* crc shift register */
392 const unsigned long e = 0xedb88320L; /* polynomial exclusive-or pattern */ 390 const unsigned long e = 0xedb88320L; /* polynomial exclusive-or pattern */
393 int i; /* counter for all possible eight bit values */ 391 int i; /* counter for all possible eight bit values */
394 int k; /* byte being shifted into crc apparatus */ 392 int k; /* byte being shifted into crc apparatus */
395 393
396 /* Compute table of CRC's. */ 394 /* Compute table of CRC's. */
397 crc_32_tab[0] = 0x00000000L;
398 for (i = 1; i < 256; i++) { 395 for (i = 1; i < 256; i++) {
399 csr = i; 396 csr = i;
400 /* The idea to initialize the register with the byte instead of 397 /* The idea to initialize the register with the byte instead of