]> git.pld-linux.org Git - packages/texinfo.git/blob - texinfo-zlib.patch
- /etc/X11/applnk -> /usr/X11R6/share/applnk
[packages/texinfo.git] / texinfo-zlib.patch
1 --- texinfo-3.12f/util/install-info.c.zlib      Wed Mar 17 18:35:46 1999
2 +++ texinfo-3.12f/util/install-info.c   Wed Mar 17 18:35:47 1999
3 @@ -19,6 +19,7 @@
4  
5  #include "system.h"
6  #include <getopt.h>
7 +#include <zlib.h>
8  
9  static char *progname = "install-info";
10  
11 @@ -474,7 +475,7 @@
12     COMPRESSION_PROGRAM.  The compression program is determined by the
13     magic number, not the filename.  */
14  
15 -FILE *
16 +gzFile
17  open_possibly_compressed_file (filename, create_callback,
18                                 opened_filename, compression_program, is_pipe)
19       char *filename;
20 @@ -486,7 +487,7 @@
21    char *local_opened_filename, *local_compression_program;
22    int nread;
23    char data[4];
24 -  FILE *f;
25 +  gzFile *f;
26  
27    /* We let them pass NULL if they don't want this info, but it's easier
28       to always determine it.  */
29 @@ -494,23 +495,23 @@
30      opened_filename = &local_opened_filename;
31  
32    *opened_filename = filename;
33 -  f = fopen (*opened_filename, FOPEN_RBIN);
34 +  f = gzopen (*opened_filename, FOPEN_RBIN);
35    if (!f)
36      {
37        *opened_filename = concat (filename, ".gz", "");
38 -      f = fopen (*opened_filename, FOPEN_RBIN);
39 +      f = gzopen (*opened_filename, FOPEN_RBIN);
40  #ifdef __MSDOS__
41        if (!f)
42          {
43            free (*opened_filename);
44            *opened_filename = concat (filename, ".igz", "");
45 -          f = fopen (*opened_filename, FOPEN_RBIN);
46 +          f = gzopen (*opened_filename, FOPEN_RBIN);
47          }
48        if (!f)
49          {
50            free (*opened_filename);
51            *opened_filename = concat (filename, ".inz", "");
52 -          f = fopen (*opened_filename, FOPEN_RBIN);
53 +          f = gzopen (*opened_filename, FOPEN_RBIN);
54          }
55  #endif
56        if (!f)
57 @@ -522,7 +523,7 @@
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);
63                if (!f)
64                  pfatal_with_name (filename);
65              }
66 @@ -531,54 +532,7 @@
67          }
68      }
69  
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);
73 -  if (nread != 1)
74 -    {
75 -      /* Empty files don't set errno, so we get something like
76 -        "install-info: No error for foo", which is confusing.  */
77 -      if (nread == 0)
78 -        fatal (_("%s: empty file"), *opened_filename);
79 -      pfatal_with_name (*opened_filename);
80 -    }
81 -
82 -  if (!compression_program)
83 -    compression_program = &local_compression_program;
84 -
85 -  if (data[0] == '\x1f' && data[1] == '\x8b')
86 -#if STRIP_DOT_EXE
87 -    /* An explicit .exe yields a better diagnostics from popen below
88 -       if they don't have gzip installed.  */
89 -    *compression_program = "gzip.exe";
90 -#else
91 -    *compression_program = "gzip";
92 -#endif
93 -  else
94 -    *compression_program = NULL;
95 -
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);
99 -      if (fclose (f) < 0)
100 -        pfatal_with_name (*opened_filename);
101 -      f = popen (command, "r");
102 -      if (f)
103 -        *is_pipe = 1;
104 -      else
105 -        pfatal_with_name (command);
106 -    }
107 -  else
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);
111 -#if O_BINARY
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);
115 -#endif
116 -      *is_pipe = 0;
117 -    }
118 +  *is_pipe = 0;
119  
120    return f;
121  }
122 @@ -601,7 +555,7 @@
123       char **compression_program;
124  {
125    char *real_name;
126 -  FILE *f;
127 +  gzFile *f;
128    int pipe_p;
129    int filled = 0;
130    int data_size = 8192;
131 @@ -615,7 +569,7 @@
132  
133    for (;;)
134      {
135 -      int nread = fread (data + filled, 1, data_size - filled, f);
136 +      int nread = gzread (f, data + filled, data_size - filled);
137        if (nread < 0)
138          pfatal_with_name (real_name);
139        if (nread == 0)
140 @@ -634,10 +588,7 @@
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
143       inside pclose.  */
144 -  if (pipe_p)
145 -    pclose (f);
146 -  else
147 -    fclose (f);
148 +  gzclose(f);
149  
150    *sizep = filled;
151    return data;
152 @@ -1245,7 +1196,7 @@
153      warning (_("no entries found for `%s'; nothing deleted"), infile);
154  
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);
158  
159    xexit (0);
160  }
161 --- texinfo-3.12f/util/Makefile.in.zlib Wed Mar 17 18:36:17 1999
162 +++ texinfo-3.12f/util/Makefile.in      Wed Mar 17 18:36:25 1999
163 @@ -102,7 +102,7 @@
164  DEFS = @DEFS@ -I. -I$(srcdir) -I..
165  CPPFLAGS = @CPPFLAGS@
166  LDFLAGS = @LDFLAGS@
167 -LIBS = @LIBS@
168 +LIBS = @LIBS@ -lz
169  install_info_SOURCES = install-info.c
170  install_info_OBJECTS =  install-info.o
171  install_info_LDADD = $(LDADD)
This page took 0.042352 seconds and 3 git commands to generate.