1
1

* view.c (view_growbuf_read_until): On short reads, try to read

one more byte to check whether we're already at the end of file.
	This makes the ">=" disappear earlier.
Этот коммит содержится в:
Roland Illig 2005-08-06 18:19:14 +00:00
родитель 725c9f7b34
Коммит 6b874e13aa
2 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -2,6 +2,9 @@
* textconf.c: Include ecs_char in the list of type
characteristics that are printed.
* view.c (view_growbuf_read_until): On short reads, try to read
one more byte to check whether we're already at the end of file.
This makes the ">=" disappear earlier.
2005-08-05 Pavel Tsekov <ptsekov@gmx.net>

Просмотреть файл

@ -376,13 +376,15 @@ view_growbuf_read_until (WView *view, offset_type ofs)
ssize_t nread;
byte *p;
size_t bytesfree;
gboolean short_read;
assert (view->growbuf_in_use);
if (view->growbuf_finished)
return;
while (view_growbuf_filesize (view) < ofs) {
short_read = FALSE;
while (view_growbuf_filesize (view) < ofs || short_read) {
if (view->growbuf_blocks == 0 || view->growbuf_lastindex == VIEW_PAGE_SIZE) {
/* Append a new block to the growing buffer */
byte *newblock = g_try_malloc (VIEW_PAGE_SIZE);
@ -421,6 +423,7 @@ view_growbuf_read_until (WView *view, offset_type ofs)
return;
}
}
short_read = (nread < bytesfree);
view->growbuf_lastindex += nread;
}
}