diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2020-11-28 06:20:20 +0100 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2020-11-28 06:20:20 +0100 |
| commit | 5d896c6fe27a25a402bf890843967804d89499a8 (patch) | |
| tree | c2e2c99311c50e97d7204f544008287ffd451d0f /src/builtin | |
| parent | 92f9a2f60fe72bbd902ebc91ed4f908eabf7560d (diff) | |
| download | minishell-5d896c6fe27a25a402bf890843967804d89499a8.tar.gz minishell-5d896c6fe27a25a402bf890843967804d89499a8.tar.bz2 minishell-5d896c6fe27a25a402bf890843967804d89499a8.zip | |
Fixing exit not exiting on argument error
Diffstat (limited to 'src/builtin')
| -rw-r--r-- | src/builtin/exit.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/builtin/exit.c b/src/builtin/exit.c index ad0bfa7..a516391 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/10/11 14:27:03 by cacharle ### ########.fr */ +/* Updated: 2020/11/28 06:16:24 by charles ### ########.fr */ /* */ /* ************************************************************************** */ @@ -41,10 +41,10 @@ int builtin_exit(char **argv, t_env env) if (errno == ERANGE || *after != '\0') { errorf("exit: %s: numeric argument required\n", argv[1]); - return (255); + exit(255); } if (argv[2] != NULL) - return (errorf_ret(1, "exit: too many arguments\n")); + exit(errorf_ret(1, "exit: too many arguments\n")); } exit(status % 256); return (0); |
