diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2020-09-28 10:58:06 +0200 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2020-09-28 10:58:06 +0200 |
| commit | a8992b41f1e88530367954a9058fe3c2d82c9d9b (patch) | |
| tree | 3d1466ebc55f4817b6f1f56f83b356f6732c42d6 /src | |
| parent | 82c2d94a6513256f9173ff62439e70d3a0b25582 (diff) | |
| download | minishell-a8992b41f1e88530367954a9058fe3c2d82c9d9b.tar.gz minishell-a8992b41f1e88530367954a9058fe3c2d82c9d9b.tar.bz2 minishell-a8992b41f1e88530367954a9058fe3c2d82c9d9b.zip | |
Fixing builtin error message and status code to work on mac
Diffstat (limited to 'src')
| -rw-r--r-- | src/builtin/cd.c | 6 | ||||
| -rw-r--r-- | src/builtin/exit.c | 4 |
2 files changed, 5 insertions, 5 deletions
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 <charles@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* 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 <charles.cabergs@gmail.com> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* 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")); |
