diff options
Diffstat (limited to 'src/b_exit.c')
-rw-r--r-- | src/b_exit.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/b_exit.c b/src/b_exit.c index 777bbb9..5f1c446 100644 --- a/src/b_exit.c +++ b/src/b_exit.c @@ -28,10 +28,9 @@ uint8_t uint8_t ret; const uint64_t argc = get_argc((const char**)args); - ret = 0; if (argc > 1) { - fail_too_many_args("exit", msh); + f_fail_too_many_args("exit", msh); return (1); } if (argc == 1) @@ -39,7 +38,11 @@ uint8_t ret = ft_atoi(args[0]); /* TODO: non numeric args[0] */ } + else + ret = msh->ret; ft_dprintf(STDERR_FILENO, "exit\n"); + lcom_clear(&msh->curr); + s_destroy(msh); exit(ret); return (0); } |