From: Bdale Garbee Date: Tue, 19 Jun 2012 20:01:51 +0000 (-0600) Subject: Merge tag 'upstream/1.5' X-Git-Tag: debian/1.5-1~18 X-Git-Url: https://git.gag.com/?p=debian%2Fgzip;a=commitdiff_plain;h=4ee107046a0ffd91f6c60c787326a5e27b799f6d Merge tag 'upstream/1.5' Upstream version 1.5 Conflicts: deflate.c gzip.1 gzip.c gzip.doc lib/getdtablesize.c lib/sys_stat.in.h m4/getdtablesize.m4 zless.in --- 4ee107046a0ffd91f6c60c787326a5e27b799f6d diff --cc configure.ac index 0919132,4705ce4..50cb427 --- a/configure.ac +++ b/configure.ac @@@ -129,14 -130,8 +130,14 @@@ if test "$gl_gcc_warnings" = yes; the AC_SUBST([GNULIB_WARN_CFLAGS]) fi +gl_FUNC_GETDTABLESIZE +if test $HAVE_GETDTABLESIZE = 0; then + AC_LIBOBJ([getdtablesize]) +fi +gl_UNISTD_MODULE_INDICATOR([getdtablesize]) + # cc -E produces incorrect asm files on SVR4, so postprocess it. - ASCPPPOST="sed '/^ *#/d; s,//.*,,; s/% /%/g; s/\\. /./g'" + ASCPPPOST="sed '/^ *\\#/d; s,//.*,,; s/% /%/g; s/\\. /./g'" AC_SUBST([ASCPPPOST]) AC_CACHE_CHECK([for underline in external names], [gzip_cv_underline], diff --cc deflate.c index a551fa3,5405f10..4a0f3d3 --- a/deflate.c +++ b/deflate.c @@@ -217,11 -209,9 +217,11 @@@ local unsigned int max_lazy_match local int compr_level; /* compression level (1..9) */ - unsigned near good_match; + unsigned good_match; /* Use a faster search when the previous match is longer than this */ +local ulg rsync_sum; /* rolling sum of rsync window */ +local ulg rsync_chunk_end; /* next rsync sequence point */ /* Values for max_lazy_match, good_match and max_chain_length, depending on * the desired pack level (0..9). The values given below have been tuned to @@@ -698,18 -654,9 +705,18 @@@ local off_t deflate_fast( /* No match, output a literal byte */ Tracevv((stderr,"%c",window[strstart])); flush = ct_tally (0, window[strstart]); + RSYNC_ROLL(strstart, 1); lookahead--; - strstart++; + strstart++; } + if (rsync && strstart > rsync_chunk_end) { + ush attr = 0; /* ascii/binary flag */ + + flush = 1; + /* Reset huffman tree */ + ct_init(&attr, &method); + rsync_chunk_end = 0xFFFFFFFFUL; + } if (flush) FLUSH_BLOCK(0), block_start = strstart; /* Make sure that we always have enough lookahead, except diff --cc gzip.c index b867350,35b3603..38e1373 --- a/gzip.c +++ b/gzip.c @@@ -437,55 -435,54 +437,57 @@@ int main (int argc, char **argv z_len = strlen(z_suffix); while ((optc = getopt_long (argc, argv, "ab:cdfhH?lLmMnNqrS:tvVZ123456789", - longopts, (int *)0)) != -1) { - switch (optc) { + longopts, (int *)0)) != -1) { + switch (optc) { case 'a': ascii = 1; break; - case 'b': - maxbits = atoi(optarg); - for (; *optarg; optarg++) - if (! ('0' <= *optarg && *optarg <= '9')) - { - fprintf (stderr, "%s: -b operand is not an integer\n", - program_name); - try_help (); - } - break; - case 'c': - to_stdout = 1; break; - case 'd': - decompress = 1; break; - case 'f': - force++; break; - case 'h': case 'H': - help(); do_exit(OK); break; - case 'l': - list = decompress = to_stdout = 1; break; - case 'L': - license(); do_exit(OK); break; - case 'm': /* undocumented, may change later */ - no_time = 1; break; - case 'M': /* undocumented, may change later */ - no_time = 0; break; - case 'n': - no_name = no_time = 1; break; - case 'N': - no_name = no_time = 0; break; - case 'q': - quiet = 1; verbose = 0; break; - case 'r': + case 'b': + maxbits = atoi(optarg); + for (; *optarg; optarg++) + if (! ('0' <= *optarg && *optarg <= '9')) + { + fprintf (stderr, "%s: -b operand is not an integer\n", + program_name); + try_help (); + } + break; + case 'c': + to_stdout = 1; break; + case 'd': + decompress = 1; break; + case 'f': + force++; break; + case 'h': case 'H': + help(); do_exit(OK); break; + case 'l': + list = decompress = to_stdout = 1; break; + case 'L': + license(); do_exit(OK); break; + case 'm': /* undocumented, may change later */ + no_time = 1; break; + case 'M': /* undocumented, may change later */ + no_time = 0; break; + case 'n': + no_name = no_time = 1; break; + case 'N': + no_name = no_time = 0; break; + case PRESUME_INPUT_TTY_OPTION: + presume_input_tty = true; break; + case 'q': + quiet = 1; verbose = 0; break; + case 'r': #if NO_DIR - fprintf (stderr, "%s: -r not supported on this system\n", - program_name); - try_help (); + fprintf (stderr, "%s: -r not supported on this system\n", + program_name); + try_help (); #else - recursive = 1; + recursive = 1; #endif - break; - case 'S': + break; + case 'R': + rsync = 1; break; + + case 'S': #ifdef NO_MULTIPLE_DOTS if (*optarg == '.') optarg++; #endif