1 --- texinfo-4.0f/util/install-info.c.orig Sat Feb 9 14:35:16 2002
2 +++ texinfo-4.0f/util/install-info.c Sat Feb 9 14:37:13 2002
9 static char *progname = "install-info";
12 COMPRESSION_PROGRAM. The compression program is determined by the
13 magic number, not the filename. */
17 open_possibly_compressed_file (filename, create_callback,
18 opened_filename, compression_program, is_pipe)
21 char *local_opened_filename, *local_compression_program;
27 /* We let them pass NULL if they don't want this info, but it's easier
28 to always determine it. */
30 opened_filename = &local_opened_filename;
32 *opened_filename = filename;
33 - f = fopen (*opened_filename, FOPEN_RBIN);
34 + f = gzopen (*opened_filename, FOPEN_RBIN);
37 *opened_filename = concat (filename, ".gz", "");
38 - f = fopen (*opened_filename, FOPEN_RBIN);
39 + f = gzopen (*opened_filename, FOPEN_RBIN);
43 free (*opened_filename);
44 *opened_filename = concat (filename, ".igz", "");
45 - f = fopen (*opened_filename, FOPEN_RBIN);
46 + f = gzopen (*opened_filename, FOPEN_RBIN);
50 free (*opened_filename);
51 *opened_filename = concat (filename, ".inz", "");
52 - f = fopen (*opened_filename, FOPEN_RBIN);
53 + f = gzopen (*opened_filename, FOPEN_RBIN);
58 /* And try opening it again. */
59 free (*opened_filename);
60 *opened_filename = filename;
61 - f = fopen (*opened_filename, FOPEN_RBIN);
62 + f = gzopen (*opened_filename, FOPEN_RBIN);
64 pfatal_with_name (filename);
70 - /* Read first few bytes of file rather than relying on the filename.
71 - If the file is shorter than this it can't be usable anyway. */
72 - nread = fread (data, sizeof (data), 1, f);
75 - /* Empty files don't set errno, so we get something like
76 - "install-info: No error for foo", which is confusing. */
78 - fatal (_("%s: empty file"), *opened_filename, 0);
79 - pfatal_with_name (*opened_filename);
82 - if (!compression_program)
83 - compression_program = &local_compression_program;
85 - if (data[0] == '\x1f' && data[1] == '\x8b')
87 - /* An explicit .exe yields a better diagnostics from popen below
88 - if they don't have gzip installed. */
89 - *compression_program = "gzip.exe";
91 - *compression_program = "gzip";
94 - *compression_program = NULL;
96 - if (*compression_program)
97 - { /* It's compressed, so fclose the file and then open a pipe. */
98 - char *command = concat (*compression_program," -cd <", *opened_filename);
100 - pfatal_with_name (*opened_filename);
101 - f = popen (command, "r");
105 - pfatal_with_name (command);
108 - { /* It's a plain file, seek back over the magic bytes. */
109 - if (fseek (f, 0, 0) < 0)
110 - pfatal_with_name (*opened_filename);
112 - /* Since this is a text file, and we opened it in binary mode,
113 - switch back to text mode. */
114 - f = freopen (*opened_filename, "r", f);
123 char **compression_program;
130 int data_size = 8192;
135 - int nread = fread (data + filled, 1, data_size - filled, f);
136 + int nread = gzread (f, data + filled, data_size - filled);
138 pfatal_with_name (real_name);
141 /* We need to close the stream, since on some systems the pipe created
142 by popen is simulated by a temporary file which only gets removed
152 @@ -1409,7 +1360,7 @@
153 warning (_("no entries found for `%s'; nothing deleted"), infile, 0);
155 output_dirfile (opened_dirfilename, dir_nlines, dir_lines, n_entries_to_add,
156 - entries_to_add, input_sections, compression_program);
157 + entries_to_add, input_sections, NULL);
161 --- texinfo-4.0f/util/Makefile.am~ Sat Feb 9 15:15:46 2002
162 +++ texinfo-4.0f/util/Makefile.am Sat Feb 9 15:15:46 2002
165 localedir = $(datadir)/locale
166 INCLUDES = -I$(top_srcdir)/lib -I../intl -DLOCALEDIR=\"$(localedir)\"
167 -LDADD = ../lib/libtxi.a @INTLLIBS@
168 +LDADD = ../lib/libtxi.a @INTLLIBS@ -lz
170 # Most of these are for fun. The only one that's really supported is texi2dvi.
171 EXTRA_DIST = README deref.c fix-info-dir fixfonts \