Репозитории ALT
Группа :: Издательство
Пакет: texinfo
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: texinfo-4.13-rh-alt-readfile.patch
Скачать
Скачать
--- texinfo/install-info/install-info.c
+++ texinfo/install-info/install-info.c
@@ -799,13 +799,11 @@ readfile (char *filename, int *sizep,
char **compression_program)
{
char *real_name;
- FILE *f;
- 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);
@@ -819,9 +817,9 @@ readfile (char *filename, int *sizep,
break;
filled += nread;
- if (filled == data_size)
+ if (data_size - filled < 8192)
{
- data_size += 65536;
+ data_size <<= 1;
data = xrealloc (data, data_size);
}
}