From a8992b41f1e88530367954a9058fe3c2d82c9d9b Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Mon, 28 Sep 2020 10:58:06 +0200 Subject: Fixing builtin error message and status code to work on mac --- src/builtin/cd.c | 6 +++--- src/builtin/exit.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/builtin') diff --git a/src/builtin/cd.c b/src/builtin/cd.c index 815149f..d95f6b7 100644 --- a/src/builtin/cd.c +++ b/src/builtin/cd.c @@ -6,7 +6,7 @@ /* By: charles +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/04/01 17:10:20 by charles #+# #+# */ -/* Updated: 2020/09/15 17:03:32 by charles ### ########.fr */ +/* Updated: 2020/09/28 10:54:15 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -30,8 +30,8 @@ int builtin_cd(char **argv, t_env env) char *home; (void)env; - if (argv[1] != NULL && argv[2] != NULL) - return (errorf_ret(1, "cd: too many arguments\n")); + /* if (argv[1] != NULL && argv[2] != NULL) */ + /* return (1); //errorf_ret(1, "cd: too many arguments\n")); */ if (argv[1] != NULL && argv[1][0] == '\0') return (0); if (argv[1] == NULL) diff --git a/src/builtin/exit.c b/src/builtin/exit.c index aa09af7..aa70a00 100644 --- a/src/builtin/exit.c +++ b/src/builtin/exit.c @@ -6,7 +6,7 @@ /* By: charles +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/04/01 17:10:16 by charles #+# #+# */ -/* Updated: 2020/09/16 16:26:08 by charles ### ########.fr */ +/* Updated: 2020/09/28 10:51:42 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -41,7 +41,7 @@ int builtin_exit(char **argv, t_env env) if (*after != '\0' || errno == ERANGE) { errorf("exit: %s: numeric argument required\n", argv[1]); - return (2); + return (255); } if (argv[2] != NULL) return (errorf_ret(1, "exit: too many arguments\n")); -- cgit