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:
parent
394c9f894c
commit
e5b5a82970
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user