Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37567930
en ru br
ALT Linux repos
S:7.0.3-alt1
5.0: 4.11-alt4
4.1: 4.11-alt3
4.0: 4.8-alt4
3.0: 4.8-alt2

Group :: Publishing
RPM: texinfo

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: texinfo-4.7-rh-alt-readfile.patch
Download


--- texinfo-4.7/util/install-info.c.orig	2004-12-30 16:36:59 +0300
+++ texinfo-4.7/util/install-info.c	2004-12-30 16:36:59 +0300
@@ -609,14 +609,12 @@
     char **compression_program)
 {
   char *real_name;
-  FILE *f;
   int pipe_p;
-  int filled = 0;
-  int data_size = 8192;
+  unsigned data_size = 8192, filled = 0;
   char *data = xmalloc (data_size);
 
   /* If they passed the space for the file name to return, use it.  */
-  f = open_possibly_compressed_file (filename, create_callback,
+  FILE *f = open_possibly_compressed_file (filename, create_callback,
                                      opened_filename ? opened_filename
                                                      : &real_name,
                                      compression_program, &pipe_p);
@@ -630,9 +628,9 @@
         break;
 
       filled += nread;
-      if (filled == data_size)
+      if (data_size - filled < 8192)
         {
-          data_size += 65536;
+          data_size <<= 1;
           data = xrealloc (data, data_size);
         }
     }
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin