From 6295ae273d4a15b60b580344b986986d004c22ad Mon Sep 17 00:00:00 2001 From: BanceDev Date: Tue, 15 Oct 2024 11:40:26 -0400 Subject: updated help messages --- src/lua_api.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/lua_api.c') diff --git a/src/lua_api.c b/src/lua_api.c index f726e44..e9473a0 100644 --- a/src/lua_api.c +++ b/src/lua_api.c @@ -110,7 +110,7 @@ static int execute_command(lua_State *L, const char *line) { if (status == -1) { fprintf(stderr, "lush: Expected end of quoted string\n"); } else if (lush_run(L, args, status) != 0) { - exit(1); + return -1; } for (int i = 0; args[i]; i++) { @@ -118,7 +118,7 @@ static int execute_command(lua_State *L, const char *line) { } free(args); free(commands); - return status; + return 0; } static char *get_expanded_path(const char *check_item) { @@ -155,7 +155,7 @@ static char *get_expanded_path(const char *check_item) { static int l_execute_command(lua_State *L) { const char *command = luaL_checkstring(L, 1); int status = execute_command(L, command); - bool rc = status != -1 ? true : false; + bool rc = status == 0 ? true : false; if (debug_mode) { if (rc) -- cgit v1.2.3-59-g8ed1b