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.
This commit is contained in:
Kartik K. Agaram 2022-04-11 23:32:56 -07:00
parent 394c9f894c
commit e5b5a82970
1 changed files with 1 additions and 1 deletions

View File

@ -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);