From 55860037b14fb3893ba21cf2654c83d349cc1082 Mon Sep 17 00:00:00 2001 From: sanine Date: Sat, 16 Apr 2022 11:37:44 -0500 Subject: fix bug in main script loader and rename honey_gl.c -> honey_window.c --- src/main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index a55dc6f..a92541d 100644 --- a/src/main.c +++ b/src/main.c @@ -41,15 +41,16 @@ int main(int argc, char **argv) /* load main script */ honey_debug("loading '%s'\n", options.main_script); - if (luaL_loadfile(L, options.main_script)) { + if (luaL_loadfile(L, options.main_script) != 0) { const char *error = lua_tostring(L, -1); honey_fatal("%s\n", error); return 1; } - if (!hs_call(L, 0, 0)) { + if (hs_call(L, 0, 0) != 0) { + honey_debug("stack size: %d\n", lua_gettop(L)); const char *error = lua_tostring(L, -1); - honey_fatal("unhandled error: %s", error); + honey_fatal("error loading main file: %s\n", error); goto close; /* sorry */ } -- cgit v1.2.1