From 584c443ac4aaad6d735386885ce43d3347b82d0f Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 8 May 2020 17:25:44 +0200 Subject: Changed Lua filename to be an argument --- plop.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plop.c b/plop.c index 1485aa7..1dff60f 100644 --- a/plop.c +++ b/plop.c @@ -166,14 +166,14 @@ int main(int argc, char ** argv) lua_State * L = luaL_newstate(); luaL_openlibs(L); - if (LUA_OK != luaL_dofile(L, "default.lua")) + if (3 != argc) { - return 2; // TODO: Document error codes/print usage information + return 1; // TODO: Document error codes/print usage information } - if (2 != argc) + if (LUA_OK != luaL_dofile(L, argv[2])) { - return 1; // TODO: Document error codes/print usage information + return 2; // TODO: Document error codes/print usage information } static const int max_clients = 200; -- cgit v1.1