diff -uprk.orig texinfo-4.8.orig/util/install-info.c texinfo-4.8/util/install-info.c --- texinfo-4.8.orig/util/install-info.c 2004-04-11 21:56:47 +0400 +++ texinfo-4.8/util/install-info.c 2005-01-04 18:02:42 +0300 @@ -20,6 +20,7 @@ #include "system.h" #include +#include static char *progname = "install-info"; @@ -545,11 +546,11 @@ open_possibly_compressed_file (char *fil 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); @@ -562,13 +563,13 @@ open_possibly_compressed_file (char *fil { 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) @@ -580,7 +581,7 @@ open_possibly_compressed_file (char *fil /* 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); } @@ -589,66 +590,7 @@ open_possibly_compressed_file (char *fil } } - /* 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); - if (nread != 1) - { - /* Empty files don't set errno, so we get something like - "install-info: No error for foo", which is confusing. */ - if (nread == 0) - fatal (_("%s: empty file"), *opened_filename, 0); - pfatal_with_name (*opened_filename); - } - - if (!compression_program) - compression_program = &local_compression_program; - - if (data[0] == '\x1f' && data[1] == '\x8b') -#if STRIP_DOT_EXE - /* An explicit .exe yields a better diagnostics from popen below - if they don't have gzip installed. */ - *compression_program = "gzip.exe"; -#else - *compression_program = "gzip"; -#endif - else if(data[0] == 'B' && data[1] == 'Z' && data[2] == 'h') -#ifndef STRIP_DOT_EXE - *compression_program = "bzip2.exe"; -#else - *compression_program = "bzip2"; -#endif - else if(data[0] == 'B' && data[1] == 'Z' && data[2] == '0') -#ifndef STRIP_DOT_EXE - *compression_program = "bzip.exe"; -#else - *compression_program = "bzip"; -#endif - else - *compression_program = NULL; - - if (*compression_program) - { /* It's compressed, so fclose the file and then open a pipe. */ - char *command = concat (*compression_program," -cd <", *opened_filename); - if (fclose (f) < 0) - pfatal_with_name (*opened_filename); - f = popen (command, "r"); - if (f) - *is_pipe = 1; - else - pfatal_with_name (command); - } - else - { /* It's a plain file, seek back over the magic bytes. */ - if (fseek (f, 0, 0) < 0) - pfatal_with_name (*opened_filename); -#if O_BINARY - /* Since this is a text file, and we opened it in binary mode, - switch back to text mode. */ - f = freopen (*opened_filename, "r", f); -#endif - *is_pipe = 0; - } + *is_pipe = 0; return f; } @@ -700,10 +642,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; @@ -1449,7 +1388,7 @@ For more information about these matters warning (_("no entries found for `%s'; nothing deleted"), infile, 0); output_dirfile (opened_dirfilename, dir_nlines, dir_lines, n_entries_to_add, - entries_to_add, input_sections, compression_program); + entries_to_add, input_sections, NULL); xexit (0); return 0; /* Avoid bogus warnings. */ diff -uprk.orig texinfo-4.8.orig/util/Makefile.am texinfo-4.8/util/Makefile.am --- texinfo-4.8.orig/util/Makefile.am 2004-08-26 15:43:18 +0400 +++ texinfo-4.8/util/Makefile.am 2005-01-04 18:02:42 +0300 @@ -24,7 +24,7 @@ transform = s/ginstall-info/install-info localedir = $(datadir)/locale INCLUDES = -I$(top_srcdir)/lib -I../intl -DLOCALEDIR=\"$(localedir)\" -LDADD = ../lib/libtxi.a $(LIBINTL) +LDADD = ../lib/libtxi.a $(LIBINTL) -lzio -lz -lbz2 dist_pkgdata_DATA = texinfo.dtd texinfo.xsl pkgdata_DATA = texinfo.cat diff -uprk.orig texinfo-4.8.orig/util/Makefile.in texinfo-4.8/util/Makefile.in --- texinfo-4.8.orig/util/Makefile.in 2004-12-31 21:01:49 +0300 +++ texinfo-4.8/util/Makefile.in 2005-01-04 18:05:21 +0300 @@ -243,7 +243,7 @@ bin_SCRIPTS = texi2dvi texi2pdf ginstall_info_SOURCES = install-info.c localedir = $(datadir)/locale INCLUDES = -I$(top_srcdir)/lib -I../intl -DLOCALEDIR=\"$(localedir)\" -LDADD = ../lib/libtxi.a $(LIBINTL) +LDADD = ../lib/libtxi.a $(LIBINTL) -lzio -lz -lbz2 dist_pkgdata_DATA = texinfo.dtd texinfo.xsl pkgdata_DATA = texinfo.cat