X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=gzip.c;h=cceb42000d48e80536f3c352a103c6cea63aa644;hb=bc893ca8b6c2ebcd8d8ac26c358c0478eace65ea;hp=93cc7384ff3959664807e7dad470fe01f4c4f99c;hpb=d57728a6ca2413a7c564d8b7bb13d9e5a5a180f3;p=debian%2Fgzip diff --git a/gzip.c b/gzip.c index 93cc738..cceb420 100644 --- a/gzip.c +++ b/gzip.c @@ -215,6 +215,7 @@ int ofd; /* output file descriptor */ unsigned insize; /* valid bytes in inbuf */ unsigned inptr; /* index of next byte to be processed in inbuf */ unsigned outcnt; /* bytes in output buffer */ +int rsync = 0; /* make ryncable chunks */ static int handled_sig[] = { @@ -275,7 +276,7 @@ static const struct option longopts[] = {"best", 0, 0, '9'}, /* compress better */ {"lzw", 0, 0, 'Z'}, /* make output compatible with old compress */ {"bits", 1, 0, 'b'}, /* max number of bits per code (implies -Z) */ - + {"rsyncable", 0, 0, 'R'}, /* make rsync-friendly archive */ { 0, 0, 0, 0 } }; @@ -359,6 +360,7 @@ local void help() " -Z, --lzw produce output compatible with old compress", " -b, --bits=BITS max number of bits per code (implies -Z)", #endif + " --rsyncable Make rsync-friendly archive", "", "With no FILE, or when FILE is -, read standard input.", "", @@ -489,8 +491,11 @@ int main (int argc, char **argv) #else recursive = 1; #endif - break; - case 'S': + break; + case 'R': + rsync = 1; break; + + case 'S': #ifdef NO_MULTIPLE_DOTS if (*optarg == '.') optarg++; #endif @@ -557,7 +562,11 @@ int main (int argc, char **argv) ALLOC(ush, tab_prefix1, 1L<<(BITS-1)); #endif +#ifdef SIGPIPE exiting_signal = quiet ? SIGPIPE : 0; +#else + exiting_signal = 0; +#endif install_signal_handlers (); /* And get to work */