1 diff -Nru texinfo-4.0/util/Makefile.am texinfo-4.0.new/util/Makefile.am
2 --- texinfo-4.0/util/Makefile.am Sat Jul 17 00:00:26 1999
3 +++ texinfo-4.0.new/util/Makefile.am Thu Oct 12 21:33:37 2000
6 localedir = $(datadir)/locale
7 INCLUDES = -I$(top_srcdir)/lib -I../intl -DLOCALEDIR=\"$(localedir)\"
8 -LDADD = ../lib/libtxi.a @INTLLIBS@
9 +LDADD = ../lib/libtxi.a -lz @INTLLIBS@
11 # Most of these are just for fun. The only one that's really supported
13 diff -Nru texinfo-4.0/util/install-info.c texinfo-4.0.new/util/install-info.c
14 --- texinfo-4.0/util/install-info.c Thu Oct 12 21:34:07 2000
15 +++ texinfo-4.0.new/util/install-info.c Thu Oct 12 21:33:06 2000
22 static char *progname = "install-info";
25 COMPRESSION_PROGRAM. The compression program is determined by the
26 magic number, not the filename. */
30 open_possibly_compressed_file (filename, create_callback,
31 opened_filename, compression_program, is_pipe)
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. */
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);
56 free (*opened_filename);
57 *opened_filename = concat (filename, ".igz", "");
58 - f = fopen (*opened_filename, FOPEN_RBIN);
59 + f = gzopen (*opened_filename, FOPEN_RBIN);
63 free (*opened_filename);
64 *opened_filename = concat (filename, ".inz", "");
65 - f = fopen (*opened_filename, FOPEN_RBIN);
66 + f = gzopen (*opened_filename, FOPEN_RBIN);
71 /* And try opening it again. */
72 free (*opened_filename);
73 *opened_filename = filename;
74 - f = fopen (*opened_filename, FOPEN_RBIN);
75 + f = gzopen (*opened_filename, FOPEN_RBIN);
77 pfatal_with_name (filename);
83 - /* Read first few bytes of file rather than relying on the filename.
84 - If the file is shorter than this it can't be usable anyway. */
85 - nread = fread (data, sizeof (data), 1, f);
88 - /* Empty files don't set errno, so we get something like
89 - "install-info: No error for foo", which is confusing. */
91 - fatal (_("%s: empty file"), *opened_filename);
92 - pfatal_with_name (*opened_filename);
95 - if (!compression_program)
96 - compression_program = &local_compression_program;
98 - if (data[0] == '\x1f' && data[1] == '\x8b')
100 - /* An explicit .exe yields a better diagnostics from popen below
101 - if they don't have gzip installed. */
102 - *compression_program = "gzip.exe";
104 - *compression_program = "gzip";
107 - *compression_program = NULL;
109 - if (*compression_program)
110 - { /* It's compressed, so fclose the file and then open a pipe. */
111 - char *command = concat (*compression_program," -cd <", *opened_filename);
112 - if (fclose (f) < 0)
113 - pfatal_with_name (*opened_filename);
114 - f = popen (command, "r");
118 - pfatal_with_name (command);
121 - { /* It's a plain file, seek back over the magic bytes. */
122 - if (fseek (f, 0, 0) < 0)
123 - pfatal_with_name (*opened_filename);
125 - /* Since this is a text file, and we opened it in binary mode,
126 - switch back to text mode. */
127 - f = freopen (*opened_filename, "r", f);
136 char **compression_program;
143 int data_size = 8192;
148 - int nread = fread (data + filled, 1, data_size - filled, f);
149 + int nread = gzread (f, data + filled, data_size - filled);
151 pfatal_with_name (real_name);
154 /* We need to close the stream, since on some systems the pipe created
155 by popen is simulated by a temporary file which only gets removed
165 @@ -1407,7 +1358,7 @@
166 warning (_("no entries found for `%s'; nothing deleted"), infile);
168 output_dirfile (opened_dirfilename, dir_nlines, dir_lines, n_entries_to_add,
169 - entries_to_add, input_sections, compression_program);
170 + entries_to_add, input_sections, NULL);