--- 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); } }