diff options
| author | 2024-10-15 11:40:26 -0400 | |
|---|---|---|
| committer | 2024-10-15 11:40:26 -0400 | |
| commit | 6295ae273d4a15b60b580344b986986d004c22ad (patch) | |
| tree | ea8eb39136ab6f128a5388ad656c0b899a91997d /src/lua_api.c | |
| parent | v0.2.3 (diff) | |
updated help messages
Diffstat (limited to 'src/lua_api.c')
| -rw-r--r-- | src/lua_api.c | 6 |
1 files changed, 3 insertions, 3 deletions
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) |
