mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
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:
@@ -259,11 +259,13 @@ files_load( files_info_t *mi)
|
|||||||
size = 0;
|
size = 0;
|
||||||
while(1) {
|
while(1) {
|
||||||
ret = mi->fs->read( mi->file, buf, 512 );
|
ret = mi->fs->read( mi->file, buf, 512 );
|
||||||
if (ret != 512)
|
if (ret <= 0)
|
||||||
break;
|
break;
|
||||||
buf += ret;
|
buf += ret;
|
||||||
mi->filepos += ret;
|
mi->filepos += ret;
|
||||||
size += ret;
|
size += ret;
|
||||||
|
if (ret != 512)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
PUSH( size );
|
PUSH( size );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user