load: manage file size smaller than 512 bytes

Allow to load bootinfo scripts of haiku and FreeBSD.

Signed-off-by: Laurent Vivier <Laurent@vivier.eu>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@593 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
Laurent Vivier
2009-11-02 22:35:59 +00:00
parent 1e01b24657
commit b0b0192262

View File

@@ -259,11 +259,13 @@ files_load( files_info_t *mi)
size = 0;
while(1) {
ret = mi->fs->read( mi->file, buf, 512 );
if (ret != 512)
if (ret <= 0)
break;
buf += ret;
mi->filepos += ret;
size += ret;
if (ret != 512)
break;
}
PUSH( size );
}