1 diff -up texinfo-4.12/install-info/Makefile.in_old texinfo-4.12/install-info/Makefile.in
2 --- texinfo-4.12/install-info/Makefile.in_old 2008-05-13 13:33:55.000000000 +0200
3 +++ texinfo-4.12/install-info/Makefile.in 2008-05-13 13:52:35.000000000 +0200
4 @@ -114,7 +114,7 @@ binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
5 PROGRAMS = $(bin_PROGRAMS)
6 am_ginstall_info_OBJECTS = install-info.$(OBJEXT)
7 ginstall_info_OBJECTS = $(am_ginstall_info_OBJECTS)
8 -ginstall_info_LDADD = $(LDADD)
9 +ginstall_info_LDADD = $(LDADD) -lz
11 ginstall_info_DEPENDENCIES = ../lib/libtxi.a \
12 $(top_builddir)/gnulib/lib/libgnu.a $(am__DEPENDENCIES_1)
13 diff -up texinfo-4.12/install-info/install-info.c_old texinfo-4.12/install-info/install-info.c
14 --- texinfo-4.12/install-info/install-info.c_old 2008-05-13 13:52:44.000000000 +0200
15 +++ texinfo-4.12/install-info/install-info.c 2008-05-14 10:30:53.000000000 +0200
24 @@ -638,7 +639,7 @@ The first time you invoke Info you start
25 COMPRESSION_PROGRAM. The compression program is determined by the
26 magic number, not the filename. */
30 open_possibly_compressed_file (char *filename,
31 void (*create_callback) (char *),
32 char **opened_filename, char **compression_program, int *is_pipe)
33 @@ -646,7 +647,7 @@ open_possibly_compressed_file (char *fil
34 char *local_opened_filename, *local_compression_program;
40 /* We let them pass NULL if they don't want this info, but it's easier
41 to always determine it. */
42 @@ -654,22 +655,22 @@ open_possibly_compressed_file (char *fil
43 opened_filename = &local_opened_filename;
45 *opened_filename = filename;
46 - f = fopen (*opened_filename, FOPEN_RBIN);
47 + f = gzopen (*opened_filename, FOPEN_RBIN);
50 *opened_filename = concat (filename, ".gz", "");
51 - f = fopen (*opened_filename, FOPEN_RBIN);
52 + f = gzopen (*opened_filename, FOPEN_RBIN);
55 free (*opened_filename);
56 *opened_filename = concat (filename, ".bz2", "");
57 - f = fopen (*opened_filename, FOPEN_RBIN);
58 + f = gzopen (*opened_filename, FOPEN_RBIN);
62 free (*opened_filename);
63 *opened_filename = concat (filename, ".lzma", "");
64 - f = fopen (*opened_filename, FOPEN_RBIN);
65 + f = gzopen (*opened_filename, FOPEN_RBIN);
69 @@ -677,13 +678,13 @@ open_possibly_compressed_file (char *fil
71 free (*opened_filename);
72 *opened_filename = concat (filename, ".igz", "");
73 - f = fopen (*opened_filename, FOPEN_RBIN);
74 + f = gzopen (*opened_filename, FOPEN_RBIN);
78 free (*opened_filename);
79 *opened_filename = concat (filename, ".inz", "");
80 - f = fopen (*opened_filename, FOPEN_RBIN);
81 + f = gzopen (*opened_filename, FOPEN_RBIN);
85 @@ -695,7 +696,7 @@ open_possibly_compressed_file (char *fil
86 /* And try opening it again. */
87 free (*opened_filename);
88 *opened_filename = filename;
89 - f = fopen (*opened_filename, FOPEN_RBIN);
90 + f = gzopen (*opened_filename, FOPEN_RBIN);
92 pfatal_with_name (filename);
94 @@ -706,12 +707,12 @@ open_possibly_compressed_file (char *fil
96 /* Read first few bytes of file rather than relying on the filename.
97 If the file is shorter than this it can't be usable anyway. */
98 - nread = fread (data, sizeof (data), 1, f);
100 + nread = gzread (f, data, sizeof (data));
101 + if (nread != sizeof (data))
103 /* Empty files don't set errno, so we get something like
104 "install-info: No error for foo", which is confusing. */
107 fatal (_("%s: empty file"), *opened_filename, 0);
108 pfatal_with_name (*opened_filename);
110 @@ -758,20 +759,22 @@ open_possibly_compressed_file (char *fil
112 if (*compression_program)
113 { /* It's compressed, so fclose the file and then open a pipe. */
115 char *command = concat (*compression_program," -cd <", *opened_filename);
116 - if (fclose (f) < 0)
117 + if (gzclose (f) < 0)
118 pfatal_with_name (*opened_filename);
119 - f = popen (command, "r");
121 + p = popen (command, "r");
125 pfatal_with_name (command);
129 { /* It's a plain file, seek back over the magic bytes. */
130 - if (fseek (f, 0, 0) < 0)
131 + if (gzseek (f, 0, SEEK_SET) < 0)
132 pfatal_with_name (*opened_filename);
135 /* Since this is a text file, and we opened it in binary mode,
136 switch back to text mode. */
137 f = freopen (*opened_filename, "r", f);
138 @@ -796,7 +799,7 @@ readfile (char *filename, int *sizep,
139 char **compression_program)
146 int data_size = 8192;
147 @@ -810,7 +813,12 @@ readfile (char *filename, int *sizep,
151 - int nread = fread (data + filled, 1, data_size - filled, f);
155 + nread = fread (data + filled, 1, data_size - filled, f);
157 + nread = gzread (f, data + filled, data_size - filled);
159 pfatal_with_name (real_name);
161 @@ -832,7 +840,7 @@ readfile (char *filename, int *sizep,