2017-07-24 12:28:56 +02:00
|
|
|
Index: texinfo-6.4/install-info/Makefile.in
|
2015-02-16 15:02:04 +01:00
|
|
|
===================================================================
|
2017-07-24 12:28:56 +02:00
|
|
|
--- texinfo-6.4.orig/install-info/Makefile.in
|
|
|
|
+++ texinfo-6.4/install-info/Makefile.in
|
|
|
|
@@ -221,7 +221,7 @@ am__installdirs = "$(DESTDIR)$(bindir)"
|
2015-02-16 15:02:04 +01:00
|
|
|
PROGRAMS = $(bin_PROGRAMS)
|
|
|
|
am_ginstall_info_OBJECTS = install-info.$(OBJEXT)
|
|
|
|
ginstall_info_OBJECTS = $(am_ginstall_info_OBJECTS)
|
|
|
|
-ginstall_info_LDADD = $(LDADD)
|
|
|
|
+ginstall_info_LDADD = $(LDADD) -lzio
|
|
|
|
am__DEPENDENCIES_1 =
|
|
|
|
ginstall_info_DEPENDENCIES = $(top_builddir)/gnulib/lib/libgnu.a \
|
|
|
|
$(am__DEPENDENCIES_1)
|
2017-07-24 12:28:56 +02:00
|
|
|
Index: texinfo-6.4/install-info/install-info.c
|
|
|
|
===================================================================
|
|
|
|
--- texinfo-6.4.orig/install-info/install-info.c
|
|
|
|
+++ texinfo-6.4/install-info/install-info.c
|
2015-02-16 15:02:04 +01:00
|
|
|
@@ -22,6 +22,7 @@
|
|
|
|
#include <getopt.h>
|
|
|
|
#include <regex.h>
|
|
|
|
#include <argz.h>
|
|
|
|
+#include <zio.h>
|
|
|
|
|
|
|
|
#define TAB_WIDTH 8
|
|
|
|
|
2015-08-21 07:34:14 +02:00
|
|
|
@@ -701,34 +702,59 @@ open_possibly_compressed_file (char *fil
|
2015-02-16 15:02:04 +01:00
|
|
|
|
|
|
|
*opened_filename = filename;
|
|
|
|
f = fopen (*opened_filename, FOPEN_RBIN);
|
|
|
|
+ if (!compression_program)
|
|
|
|
+ compression_program = &local_compression_program;
|
|
|
|
+ *compression_program = NULL;
|
|
|
|
+ if (f)
|
|
|
|
+ {
|
|
|
|
+ nread = fread (data, sizeof (data), 1, f);
|
|
|
|
+ if (nread == 1)
|
|
|
|
+ {
|
|
|
|
+ if (data[0] == '\x1f' && data[1] == '\x8b')
|
|
|
|
+ *compression_program = "g";
|
|
|
|
+ else if (data[0] == '\x1f' && data[1] == '\x9d')
|
|
|
|
+ *compression_program = "Z";
|
|
|
|
+ else if (data[0] == '\x1f' && data[1] == '\x9e')
|
|
|
|
+ *compression_program = "z";
|
|
|
|
+ else if (data[0] == 'B' && data[1] == 'Z' && data[2] == 'h')
|
|
|
|
+ *compression_program = "b";
|
|
|
|
+ }
|
|
|
|
+ fclose (f);
|
|
|
|
+ f = fzopen (*opened_filename, FOPEN_RBIN);
|
|
|
|
+ }
|
|
|
|
if (!f)
|
|
|
|
{
|
|
|
|
*opened_filename = concat (filename, ".gz", "");
|
|
|
|
- f = fopen (*opened_filename, FOPEN_RBIN);
|
|
|
|
+ f = fzopen (*opened_filename, FOPEN_RBIN);
|
|
|
|
+ *compression_program = "g";
|
|
|
|
}
|
|
|
|
if (!f)
|
|
|
|
{
|
2015-08-21 07:34:14 +02:00
|
|
|
free (*opened_filename);
|
|
|
|
*opened_filename = concat (filename, ".xz", "");
|
|
|
|
- f = fopen (*opened_filename, FOPEN_RBIN);
|
|
|
|
+ f = fzopen (*opened_filename, FOPEN_RBIN);
|
|
|
|
+ *compression_program = "x";
|
|
|
|
}
|
|
|
|
if (!f)
|
2015-02-16 15:02:04 +01:00
|
|
|
{
|
|
|
|
free (*opened_filename);
|
|
|
|
*opened_filename = concat (filename, ".bz2", "");
|
|
|
|
- f = fopen (*opened_filename, FOPEN_RBIN);
|
|
|
|
+ f = fzopen (*opened_filename, FOPEN_RBIN);
|
|
|
|
+ *compression_program = "b";
|
|
|
|
}
|
|
|
|
if (!f)
|
|
|
|
{
|
2015-08-21 07:34:14 +02:00
|
|
|
free (*opened_filename);
|
|
|
|
*opened_filename = concat (filename, ".lz", "");
|
|
|
|
- f = fopen (*opened_filename, FOPEN_RBIN);
|
|
|
|
+ f = fzopen (*opened_filename, FOPEN_RBIN);
|
|
|
|
+ *compression_program = "l";
|
|
|
|
}
|
|
|
|
if (!f)
|
|
|
|
{
|
|
|
|
free (*opened_filename);
|
|
|
|
*opened_filename = concat (filename, ".lzma", "");
|
|
|
|
- f = fopen (*opened_filename, FOPEN_RBIN);
|
|
|
|
+ f = fzopen (*opened_filename, FOPEN_RBIN);
|
|
|
|
+ *compression_program = "l";
|
|
|
|
}
|
|
|
|
#ifdef __MSDOS__
|
|
|
|
if (!f)
|
2017-07-24 12:28:56 +02:00
|
|
|
@@ -961,8 +987,22 @@ output_dirfile (char *dirfile, int dir_n
|
2015-08-21 07:34:14 +02:00
|
|
|
|
|
|
|
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");
|