1 diff -ur texinfo-4.1-/util/Makefile.am texinfo-4.1/util/Makefile.am
2 --- texinfo-4.1-/util/Makefile.am Mon Feb 25 17:23:45 2002
3 +++ texinfo-4.1/util/Makefile.am Sat Mar 9 15:55:11 2002
6 localedir = $(datadir)/locale
7 INCLUDES = -I$(top_srcdir)/lib -I../intl -DLOCALEDIR=\"$(localedir)\"
8 -LDADD = ../lib/libtxi.a @LIBINTL@
9 +LDADD = ../lib/libtxi.a @LIBINTL@ -lz
11 # Most of these are for fun. The only one that's really supported is texi2dvi.
12 EXTRA_DIST = README deref.c fix-info-dir fixfonts \
13 Only in texinfo-4.1/util: Makefile.am.orig
14 diff -ur texinfo-4.1-/util/install-info.c texinfo-4.1/util/install-info.c
15 --- texinfo-4.1-/util/install-info.c Sat Jan 19 02:12:29 2002
16 +++ texinfo-4.1/util/install-info.c Sat Mar 9 15:54:50 2002
23 static char *progname = "install-info";
26 COMPRESSION_PROGRAM. The compression program is determined by the
27 magic number, not the filename. */
31 open_possibly_compressed_file (filename, create_callback,
32 opened_filename, compression_program, is_pipe)
35 char *local_opened_filename, *local_compression_program;
41 /* We let them pass NULL if they don't want this info, but it's easier
42 to always determine it. */
44 opened_filename = &local_opened_filename;
46 *opened_filename = filename;
47 - f = fopen (*opened_filename, FOPEN_RBIN);
48 + f = gzopen (*opened_filename, FOPEN_RBIN);
51 *opened_filename = concat (filename, ".gz", "");
52 - f = fopen (*opened_filename, FOPEN_RBIN);
53 + f = gzopen (*opened_filename, FOPEN_RBIN);
57 free (*opened_filename);
58 *opened_filename = concat (filename, ".igz", "");
59 - f = fopen (*opened_filename, FOPEN_RBIN);
60 + f = gzopen (*opened_filename, FOPEN_RBIN);
64 free (*opened_filename);
65 *opened_filename = concat (filename, ".inz", "");
66 - f = fopen (*opened_filename, FOPEN_RBIN);
67 + f = gzopen (*opened_filename, FOPEN_RBIN);
72 /* And try opening it again. */
73 free (*opened_filename);
74 *opened_filename = filename;
75 - f = fopen (*opened_filename, FOPEN_RBIN);
76 + f = gzopen (*opened_filename, FOPEN_RBIN);
78 pfatal_with_name (filename);
84 - /* Read first few bytes of file rather than relying on the filename.
85 - If the file is shorter than this it can't be usable anyway. */
86 - nread = fread (data, sizeof (data), 1, f);
89 - /* Empty files don't set errno, so we get something like
90 - "install-info: No error for foo", which is confusing. */
92 - fatal (_("%s: empty file"), *opened_filename, 0);
93 - pfatal_with_name (*opened_filename);
96 - if (!compression_program)
97 - compression_program = &local_compression_program;
99 - if (data[0] == '\x1f' && data[1] == '\x8b')
101 - /* An explicit .exe yields a better diagnostics from popen below
102 - if they don't have gzip installed. */
103 - *compression_program = "gzip.exe";
105 - *compression_program = "gzip";
108 - *compression_program = NULL;
110 - if (*compression_program)
111 - { /* It's compressed, so fclose the file and then open a pipe. */
112 - char *command = concat (*compression_program," -cd <", *opened_filename);
113 - if (fclose (f) < 0)
114 - pfatal_with_name (*opened_filename);
115 - f = popen (command, "r");
119 - pfatal_with_name (command);
122 - { /* It's a plain file, seek back over the magic bytes. */
123 - if (fseek (f, 0, 0) < 0)
124 - pfatal_with_name (*opened_filename);
126 - /* Since this is a text file, and we opened it in binary mode,
127 - switch back to text mode. */
128 - f = freopen (*opened_filename, "r", f);
137 char **compression_program;
144 int data_size = 8192;
149 - int nread = fread (data + filled, 1, data_size - filled, f);
150 + int nread = gzread (f, data + filled, data_size - filled);
152 pfatal_with_name (real_name);
155 /* We need to close the stream, since on some systems the pipe created
156 by popen is simulated by a temporary file which only gets removed
166 @@ -1409,7 +1360,7 @@
167 warning (_("no entries found for `%s'; nothing deleted"), infile, 0);
169 output_dirfile (opened_dirfilename, dir_nlines, dir_lines, n_entries_to_add,
170 - entries_to_add, input_sections, compression_program);
171 + entries_to_add, input_sections, NULL);