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],
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
/* 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
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