瀏覽代碼

Fix problem reading files a multiple of 128 bytes long (#3280)

Philip Gladstone 3 年之前
父節點
當前提交
f527ad86e4
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      app/modules/file.c

+ 3 - 0
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;
     }