From c000a0894af040b5fe00d00370b030431dcc364c Mon Sep 17 00:00:00 2001 From: Philip Gladstone Date: Sun, 13 Sep 2020 11:37:54 -0400 Subject: [PATCH] Fix problem reading files a multiple of 128 bytes long (#3280) --- app/modules/file.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/modules/file.c b/app/modules/file.c index 8ecc7801..e3157465 100644 --- a/app/modules/file.c +++ b/app/modules/file.c @@ -442,6 +442,9 @@ static int file_g_read( lua_State* L, int n, int16_t end_char, int fd ) int nread = vfs_read(fd, p, nwanted); if (nread == VFS_RES_ERR || nread == 0) { + if (j > 0) { + break; + } lua_pushnil(L); return 1; }