]>
Commit | Line | Data |
---|---|---|
1ab16a4e MM |
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 | |
4 | @@ -7,7 +7,7 @@ | |
5 | ||
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 | |
10 | ||
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 | |
88542f05 | 17 | @@ -19,6 +19,7 @@ |
18 | ||
19 | #include "system.h" | |
20 | #include <getopt.h> | |
21 | +#include <zlib.h> | |
22 | ||
23 | static char *progname = "install-info"; | |
24 | ||
b1f55548 | 25 | @@ -481,7 +482,7 @@ |
88542f05 | 26 | COMPRESSION_PROGRAM. The compression program is determined by the |
27 | magic number, not the filename. */ | |
28 | ||
29 | -FILE * | |
30 | +gzFile | |
31 | open_possibly_compressed_file (filename, create_callback, | |
32 | opened_filename, compression_program, is_pipe) | |
33 | char *filename; | |
b1f55548 | 34 | @@ -493,7 +494,7 @@ |
88542f05 | 35 | char *local_opened_filename, *local_compression_program; |
36 | int nread; | |
37 | char data[4]; | |
38 | - FILE *f; | |
39 | + gzFile *f; | |
40 | ||
41 | /* We let them pass NULL if they don't want this info, but it's easier | |
42 | to always determine it. */ | |
b1f55548 | 43 | @@ -501,23 +502,23 @@ |
88542f05 | 44 | opened_filename = &local_opened_filename; |
45 | ||
46 | *opened_filename = filename; | |
47 | - f = fopen (*opened_filename, FOPEN_RBIN); | |
48 | + f = gzopen (*opened_filename, FOPEN_RBIN); | |
49 | if (!f) | |
50 | { | |
51 | *opened_filename = concat (filename, ".gz", ""); | |
52 | - f = fopen (*opened_filename, FOPEN_RBIN); | |
53 | + f = gzopen (*opened_filename, FOPEN_RBIN); | |
54 | #ifdef __MSDOS__ | |
55 | if (!f) | |
56 | { | |
57 | free (*opened_filename); | |
58 | *opened_filename = concat (filename, ".igz", ""); | |
59 | - f = fopen (*opened_filename, FOPEN_RBIN); | |
60 | + f = gzopen (*opened_filename, FOPEN_RBIN); | |
61 | } | |
62 | if (!f) | |
63 | { | |
64 | free (*opened_filename); | |
65 | *opened_filename = concat (filename, ".inz", ""); | |
66 | - f = fopen (*opened_filename, FOPEN_RBIN); | |
67 | + f = gzopen (*opened_filename, FOPEN_RBIN); | |
68 | } | |
69 | #endif | |
70 | if (!f) | |
b1f55548 | 71 | @@ -529,7 +530,7 @@ |
88542f05 | 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); | |
77 | if (!f) | |
78 | pfatal_with_name (filename); | |
79 | } | |
b1f55548 | 80 | @@ -538,54 +539,7 @@ |
88542f05 | 81 | } |
82 | } | |
83 | ||
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); | |
87 | - if (nread != 1) | |
88 | - { | |
89 | - /* Empty files don't set errno, so we get something like | |
b1f55548 | 90 | - "install-info: No error for foo", which is confusing. */ |
88542f05 | 91 | - if (nread == 0) |
f39404e2 | 92 | - fatal (_("%s: empty file"), *opened_filename, 0); |
88542f05 | 93 | - pfatal_with_name (*opened_filename); |
94 | - } | |
95 | - | |
96 | - if (!compression_program) | |
97 | - compression_program = &local_compression_program; | |
98 | - | |
99 | - if (data[0] == '\x1f' && data[1] == '\x8b') | |
100 | -#if STRIP_DOT_EXE | |
101 | - /* An explicit .exe yields a better diagnostics from popen below | |
102 | - if they don't have gzip installed. */ | |
103 | - *compression_program = "gzip.exe"; | |
104 | -#else | |
105 | - *compression_program = "gzip"; | |
106 | -#endif | |
107 | - else | |
108 | - *compression_program = NULL; | |
109 | - | |
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"); | |
116 | - if (f) | |
117 | - *is_pipe = 1; | |
118 | - else | |
119 | - pfatal_with_name (command); | |
120 | - } | |
121 | - else | |
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); | |
125 | -#if O_BINARY | |
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); | |
129 | -#endif | |
d8304022 | 130 | - *is_pipe = 0; |
88542f05 | 131 | - } |
d8304022 | 132 | + *is_pipe = 0; |
88542f05 | 133 | |
134 | return f; | |
135 | } | |
b1f55548 | 136 | @@ -608,7 +562,7 @@ |
88542f05 | 137 | char **compression_program; |
138 | { | |
139 | char *real_name; | |
140 | - FILE *f; | |
141 | + gzFile *f; | |
142 | int pipe_p; | |
143 | int filled = 0; | |
144 | int data_size = 8192; | |
b1f55548 | 145 | @@ -622,7 +576,7 @@ |
88542f05 | 146 | |
147 | for (;;) | |
148 | { | |
149 | - int nread = fread (data + filled, 1, data_size - filled, f); | |
150 | + int nread = gzread (f, data + filled, data_size - filled); | |
151 | if (nread < 0) | |
152 | pfatal_with_name (real_name); | |
153 | if (nread == 0) | |
b1f55548 | 154 | @@ -641,10 +595,7 @@ |
88542f05 | 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 | |
157 | inside pclose. */ | |
158 | - if (pipe_p) | |
159 | - pclose (f); | |
160 | - else | |
161 | - fclose (f); | |
162 | + gzclose(f); | |
163 | ||
164 | *sizep = filled; | |
165 | return data; | |
f39404e2 | 166 | @@ -1409,7 +1360,7 @@ |
167 | warning (_("no entries found for `%s'; nothing deleted"), infile, 0); | |
88542f05 | 168 | |
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); | |
172 | ||
173 | xexit (0); | |
174 | } |