diff options
| author | Kartik K. Agaram <vc@akkartik.com> | 2022-04-11 23:32:56 -0700 |
|---|---|---|
| committer | Kartik K. Agaram <vc@akkartik.com> | 2022-04-11 23:32:56 -0700 |
| commit | e5b5a82970ac60c8072e10234eb116db2f7e7f71 (patch) | |
| tree | 670872d94a3d7cf2a60694acfb27db49f9d3ee4a | |
| parent | 394c9f894c48925b53da610d907b5a66ee1e61f0 (diff) | |
| download | teliva-e5b5a82970ac60c8072e10234eb116db2f7e7f71.tar.gz | |
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.
| -rw-r--r-- | src/lua.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); |