diff --git a/builtins/cd.c b/builtins/cd.c index 336b3ea..30eab3a 100644 --- a/builtins/cd.c +++ b/builtins/cd.c @@ -6,7 +6,7 @@ /* By: erey-bet +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/02/20 14:27:36 by erey-bet #+# #+# */ -/* Updated: 2023/03/21 13:16:24 by erey-bet ### ########.fr */ +/* Updated: 2023/03/30 15:04:09 by erey-bet ### ########.fr */ /* */ /* ************************************************************************** */ @@ -24,7 +24,7 @@ int make_move(char *path, int fd) return (0); } free(join); - write(2, "No such file or directory\n", 26); + write(2, "cd: No such file or directory\n", 30); return (1); } @@ -42,7 +42,7 @@ int move_folder(char **args, int fd) { if (chdir(path) == 0) return (0); - write(2, "No such file or directory\n", 26); + write(2, "cd: No such file or directory\n", 30); return (1); } else diff --git a/builtins/echo.c b/builtins/echo.c index f05d199..865392d 100644 --- a/builtins/echo.c +++ b/builtins/echo.c @@ -6,7 +6,7 @@ /* By: erey-bet +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/02/17 13:09:08 by erey-bet #+# #+# */ -/* Updated: 2023/03/28 15:53:52 by cchauvet ### ########.fr */ +/* Updated: 2023/03/30 13:55:40 by erey-bet ### ########.fr */ /* */ /* ************************************************************************** */ @@ -26,7 +26,7 @@ int check_argument(char *str, int *check_backslash_n) while (str[++i]) if (str[i] != '-' && str[i] != 'n') return (1); - if (ft_strnstr(str, "n", ft_strlen(str))) + if (ft_strnstr(str, "n", ft_strlen(str)) && str[0] == '-') *check_backslash_n = 1; else return (1); diff --git a/builtins/env.c b/builtins/env.c index 7d6786d..b601555 100644 --- a/builtins/env.c +++ b/builtins/env.c @@ -6,7 +6,7 @@ /* By: cchauvet +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/02/24 10:17:59 by erey-bet #+# #+# */ -/* Updated: 2023/03/10 14:52:22 by erey-bet ### ########.fr */ +/* Updated: 2023/03/30 15:04:47 by erey-bet ### ########.fr */ /* */ /* ************************************************************************** */ @@ -35,11 +35,11 @@ int ft_exit(char **args) } err = ft_atoi_check(args[0]); if (err == 1) - return (error(err, "numeric argument required", args[0])); + return (error(err, "exit: numeric argument required", args[0])); if (args[1] != NULL) - return (error(1, "too many arguments", NULL)); + return (error(1, "exit: too many arguments", NULL)); if (err > 0) - return (error(err, "numeric argument required", args[0])); + return (error(err, "exit: numeric argument required", args[0])); write(1, "exit\n", 6); return ((ft_atoi(args[0]) % 256 + 256) % 256); } diff --git a/builtins/export.c b/builtins/export.c index b8bd135..3617a7e 100644 --- a/builtins/export.c +++ b/builtins/export.c @@ -6,7 +6,7 @@ /* By: cchauvet +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/02/22 13:28:27 by erey-bet #+# #+# */ -/* Updated: 2023/02/23 15:49:21 by erey-bet ### ########.fr */ +/* Updated: 2023/03/30 15:07:10 by erey-bet ### ########.fr */ /* */ /* ************************************************************************** */ @@ -14,7 +14,7 @@ int error(char *str, int fd) { - write(fd, "bash: unset: `", 14); + write(fd, "bozoshell: unset: `", 19); write(fd, str, ft_strlen(str)); write(fd, "': not a valid identifier", 25); return (1);