diff options
| author | nass1pro <nass1pro@gmail.com> | 2020-09-13 09:17:35 +0200 |
|---|---|---|
| committer | nass1pro <nass1pro@gmail.com> | 2020-09-13 09:17:35 +0200 |
| commit | 935d1ed5ad3d20dd901a4c3cfbb8453626460f18 (patch) | |
| tree | 247b7059873131f047337dd468ab00a3be2a9d41 /src/builtin/exit.c | |
| parent | 5146be239d6ab71db602ec7b6826b6484aa0f178 (diff) | |
| parent | 65006d0c14d3efa647b3c866ab54bdb1749fa31d (diff) | |
| download | minishell-935d1ed5ad3d20dd901a4c3cfbb8453626460f18.tar.gz minishell-935d1ed5ad3d20dd901a4c3cfbb8453626460f18.tar.bz2 minishell-935d1ed5ad3d20dd901a4c3cfbb8453626460f18.zip | |
Merge branch 'master' of https://github.com/ouaisbrefbams/minishell
Diffstat (limited to 'src/builtin/exit.c')
| -rw-r--r-- | src/builtin/exit.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/builtin/exit.c b/src/builtin/exit.c index 640fc01..a24efad 100644 --- a/src/builtin/exit.c +++ b/src/builtin/exit.c @@ -6,7 +6,7 @@ /* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/04/01 17:10:16 by charles #+# #+# */ -/* Updated: 2020/08/20 17:31:18 by charles ### ########.fr */ +/* Updated: 2020/09/10 19:41:03 by charles ### ########.fr */ /* */ /* ************************************************************************** */ @@ -24,7 +24,7 @@ int builtin_exit(char **argv, t_env env) (void)env; if (argv[1] == NULL) - status = g_last_status_code; + status = g_last_status; else { errno = 0; @@ -32,15 +32,9 @@ int builtin_exit(char **argv, t_env env) while (ft_isblank(*after)) after++; if (*after != '\0' || errno == ERANGE) - { - errorf("exit: %s: numeric argument required\n", argv[1]); - return (2); - } + return (errorf_ret(2, "exit: %s: numeric argument required\n", argv[1])); if (argv[2] != NULL) - { - errorf("exit: too many arguments\n"); - return (1); - } + return (errorf_ret(1, "exit: too many arguments\n")); } exit(status % 256); return (0); |
