File texinfo-zlib.patch of Package texinfo

Index: texinfo-6.8/install-info/install-info.c
===================================================================
--- texinfo-6.8.orig/install-info/install-info.c
+++ texinfo-6.8/install-info/install-info.c
@@ -19,6 +19,7 @@
 #include <getopt.h>
 #include <regex.h>
 #include <argz.h>
+#include <zio.h>
 
 #define TAB_WIDTH 8
 
@@ -852,22 +853,33 @@ determine_file_type:
 
   if (*compression_program)
     {
-      /* Redirect stdin to the file and fork the decompression process
-         reading from stdin.  This allows shell metacharacters in filenames. */
-      char *command = concat (*compression_program, " -d", "");
-
       if (fclose (f) < 0)
         return 0;
-      f = freopen (*opened_filename, FOPEN_RBIN, stdin);
-      if (!f)
-        return 0;
-      f = popen (command, "r");
-      if (!f)
-        {
+
+      if (**compression_program == 'g' || **compression_program == 'z')
+        f = fzopen (*opened_filename, "rg");
+      if (**compression_program == 'b')
+        f = fzopen (*opened_filename, "rb");
+      if (**compression_program == 'Z')
+        f = fzopen (*opened_filename, "rZ");
+      if (**compression_program == 'l')
+        f = fzopen (*opened_filename, "rl");
+      if (**compression_program == 'x')
+        f = fzopen (*opened_filename, "rx");
+      if (!f) {
+        /* Redirect stdin to the file and fork the decompression process
+           reading from stdin.  This allows shell metacharacters in filenames. */
+        char *command = concat (*compression_program, " -d", "");
+        f = freopen (*opened_filename, FOPEN_RBIN, stdin);
+        if (!f)
+          return 0;
+        f = popen (command, "r");
+        if (!f) {
           /* Used for error message in calling code. */
           *opened_filename = command;
           return 0;
         }
+      }
     }
   else
     {
@@ -957,8 +969,22 @@ output_dirfile (char *dirfile, int dir_n
 
   if (compression_program)
     {
-      char *command = concat (compression_program, ">", dirfile);
-      output = popen (command, "w");
+      output = NULL;
+      if (*compression_program == 'g' || *compression_program == 'z')
+        output = fzopen (dirfile, "wg");
+      if (*compression_program == 'b')
+        output = fzopen (dirfile, "wb");
+      if (*compression_program == 'Z')
+        output = fzopen (dirfile, "wZ");
+      if (*compression_program == 'l')
+        output = fzopen (dirfile, "wl");
+      if (*compression_program == 'x')
+        output = fzopen (dirfile, "wx");
+      if (!output)
+      {
+        char *command = concat (compression_program, ">", dirfile);
+        output = popen (command, "w");
+      }
     }
   else
     output = fopen (dirfile, "w");
Index: texinfo-6.8/install-info/Makefile.in
===================================================================
--- texinfo-6.8.orig/install-info/Makefile.in
+++ texinfo-6.8/install-info/Makefile.in
@@ -1393,7 +1393,8 @@ AM_CPPFLAGS = \
   -I$(top_builddir)/gnulib/lib			\
   -DLOCALEDIR=\"$(localedir)\"
 
-LDADD = $(top_builddir)/gnulib/lib/libgnu.a $(LIBINTL) $(LIBTHREAD)
+LDADD = $(top_builddir)/gnulib/lib/libgnu.a $(LIBINTL) $(LIBTHREAD) -lzio 
+
 all: all-recursive
 
 .SUFFIXES:
openSUSE Build Service is sponsored by