Fixed lack of nil return in file.read() when EOF is reached
This commit is contained in:
parent
914a4afc96
commit
cbcb1b1a9f
|
@ -432,7 +432,8 @@ static int file_g_read( lua_State* L, int n, int16_t end_char, int fd )
|
||||||
luaM_free(L, heap_mem);
|
luaM_free(L, heap_mem);
|
||||||
heap_mem = NULL;
|
heap_mem = NULL;
|
||||||
}
|
}
|
||||||
return 0;
|
lua_pushnil(L);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
vfs_lseek(fd, -(n - i), VFS_SEEK_CUR);
|
vfs_lseek(fd, -(n - i), VFS_SEEK_CUR);
|
||||||
|
|
Loading…
Reference in New Issue