fix for #693463, part of the zdiff man page edits are no longer needed
[debian/gzip] / gzip.c
diff --git a/gzip.c b/gzip.c
index 35b36031f4f3f9739c442578f7e308e7894eed53..5fc6ded293c785ed584812e0b7eae73bcb0ecc9c 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[] =
   {
@@ -222,7 +223,9 @@ static int handled_sig[] =
 #ifdef SIGHUP
     , SIGHUP
 #endif
+#ifdef SIGPIPE
     , SIGPIPE
+#endif
 #ifdef SIGTERM
     , SIGTERM
 #endif
@@ -270,7 +273,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 +356,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 +485,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
@@ -549,7 +556,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 */