about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-04-11 23:32:56 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-04-11 23:32:56 -0700
commite5b5a82970ac60c8072e10234eb116db2f7e7f71 (patch)
tree670872d94a3d7cf2a60694acfb27db49f9d3ee4a
parent394c9f894c48925b53da610d907b5a66ee1e61f0 (diff)
downloadteliva-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.c2
1 files changed, 1 insertions, 1 deletions
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);