Adds zio support to read compressed info pages directly. Last rediff: 12.02.2008 by avm@altlinux.ru. --- texinfo-4.11/util/Makefile.am +++ texinfo-4.11/util/Makefile.am @@ -32,7 +32,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/gnulib/lib \ -I$(top_builddir)/gnulib/lib \ -DLOCALEDIR=\"$(localedir)\" -LDADD = ../lib/libtxi.a $(top_builddir)/gnulib/lib/libgnu.a $(LIBINTL) +LDADD = ../lib/libtxi.a $(top_builddir)/gnulib/lib/libgnu.a $(LIBINTL) -lzio dist_pkgdata_DATA = texinfo.dtd texinfo.xsl pkgdata_DATA = texinfo.cat --- texinfo-4.11/util/install-info.c +++ texinfo-4.11/util/install-info.c @@ -20,6 +20,7 @@ #include "system.h" #include #include +#include static char *progname = "install-info"; @@ -575,11 +576,11 @@ open_possibly_compressed_file (char *filename, opened_filename = &local_opened_filename; *opened_filename = filename; - f = fopen (*opened_filename, FOPEN_RBIN); + 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); if (!f) { free (*opened_filename); @@ -592,13 +593,13 @@ open_possibly_compressed_file (char *filename, { free (*opened_filename); *opened_filename = concat (filename, ".igz", ""); - f = fopen (*opened_filename, FOPEN_RBIN); + f = fzopen (*opened_filename, FOPEN_RBIN); } if (!f) { free (*opened_filename); *opened_filename = concat (filename, ".inz", ""); - f = fopen (*opened_filename, FOPEN_RBIN); + f = fzopen (*opened_filename, FOPEN_RBIN); } #endif if (!f) @@ -610,7 +611,7 @@ open_possibly_compressed_file (char *filename, /* And try opening it again. */ free (*opened_filename); *opened_filename = filename; - f = fopen (*opened_filename, FOPEN_RBIN); + f = fzopen (*opened_filename, FOPEN_RBIN); if (!f) pfatal_with_name (filename); } @@ -619,6 +620,7 @@ open_possibly_compressed_file (char *filename, } } +#if 0 /* Read first few bytes of file rather than relying on the filename. If the file is shorter than this it can't be usable anyway. */ nread = fread (data, sizeof (data), 1, f); @@ -679,6 +681,8 @@ open_possibly_compressed_file (char *filename, #endif *is_pipe = 0; } +#endif + *is_pipe = 0; return f; } @@ -730,10 +734,7 @@ readfile (char *filename, int *sizep, /* We need to close the stream, since on some systems the pipe created by popen is simulated by a temporary file which only gets removed inside pclose. */ - if (pipe_p) - pclose (f); - else - fclose (f); + fclose(f); *sizep = filled; return data; @@ -1554,7 +1555,7 @@ There is NO WARRANTY, to the extent permitted by law.\n"), else output_dirfile (opened_dirfilename, dir_nlines, dir_lines, n_entries_to_add, entries_to_add, - input_sections, compression_program); + input_sections, NULL); xexit (0); return 0; /* Avoid bogus warnings. */