From ebfce4a9111dd6e1c1c35352c2198a8f566639f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Voborsk=C3=BD?= Date: Tue, 29 Sep 2020 23:16:53 +0200 Subject: [PATCH] Fixing bug in `file.readline` when line length exceeds 128 chars --- app/modules/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/modules/file.c b/app/modules/file.c index e3157465..4d6a6f98 100644 --- a/app/modules/file.c +++ b/app/modules/file.c @@ -452,7 +452,7 @@ static int file_g_read( lua_State* L, int n, int16_t end_char, int fd ) for (i = 0; i < nread; ++i) { luaL_addchar(&b, p[i]); if (p[i] == end_char) { - vfs_lseek(fd, -nread + j + i + 1, VFS_SEEK_CUR); //reposition after end char found + vfs_lseek(fd, -nread + i + 1, VFS_SEEK_CUR); //reposition after end char found nread = 0; // force break on outer loop break; }