Merge tag 'upstream/1.5'
[debian/gzip] / gzip.c
diff --git a/gzip.c b/gzip.c
index 35b36031f4f3f9739c442578f7e308e7894eed53..38e1373e474edd30a0a71825b7281d8429948a9c 100644 (file)
--- a/gzip.c
+++ b/gzip.c
@@ -213,6 +213,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[] =
   {
@@ -270,7 +271,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 }
 };
 
@@ -353,6 +354,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.",
  "",
@@ -481,8 +483,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