From e5b5a82970ac60c8072e10234eb116db2f7e7f71 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 11 Apr 2022 23:32:56 -0700 Subject: [PATCH] a sharp edge in Lua's dorequire() You can't call it on a file that isn't a module, i.e. that doesn't return something at the end. Use dofile() instead. --- src/lua.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lua.c b/src/lua.c index c78b051..d6095ca 100644 --- a/src/lua.c +++ b/src/lua.c @@ -239,7 +239,7 @@ static int pmain (lua_State *L) { if (status != 0) return 0; status = dorequire(L, "src/task.lua", "task"); if (status != 0) return 0; - status = dorequire(L, "src/file.lua", "file"); + status = dofile(L, "src/file.lua"); if (status != 0) return 0; lua_gc(L, LUA_GCRESTART, 0);