diff options
author | sanine-a <sanine.not@pm.me> | 2020-10-27 20:58:46 -0500 |
---|---|---|
committer | sanine-a <sanine.not@pm.me> | 2020-10-27 20:58:46 -0500 |
commit | c3698446644365283fcd3d3f47f3eea67cad8331 (patch) | |
tree | 4ad91fc176600f21a0bc298012635178a75d92d9 /src/honey.c | |
parent | 7dcdcc6824a515417d0e663277acf0a6b2cd1747 (diff) |
fix bug with working directory and add Vector and Matrix wrappers
Diffstat (limited to 'src/honey.c')
-rw-r--r-- | src/honey.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/honey.c b/src/honey.c index 17b0648..c63ab2f 100644 --- a/src/honey.c +++ b/src/honey.c @@ -97,16 +97,9 @@ bool honey_run(lua_State* L, honey_options opts) { honey_window_information* info = lua_touserdata(L, -1); honey_window window = info->window; - char* script; - honey_result res = honey_format_string(&script, - "%s/main.lua", - opts.script_directory); - if (res != HONEY_OK) { - fprintf(stderr, "[honey] FATAL: could not allocate space for script filename!"); - return false; - } + chdir(opts.script_directory); - if (luaL_loadfile(L, script) == 0) { + if (luaL_loadfile(L, "main.lua") == 0) { if (!honey_lua_pcall(L, 0, 1) == 0) { const char* error = lua_tostring(L, -1); fprintf(stderr, "[honey] ERROR: %s\n", error); @@ -116,8 +109,7 @@ bool honey_run(lua_State* L, honey_options opts) { else { fprintf(stderr, - "[honey] ERROR: failed to load %s: %s!\n", - script, + "[honey] ERROR: failed to load main.lua: %s!\n", lua_tostring(L, -1)); return false; } |