From 51d7e60790763d04563e09f10de1cf03d5e29a39 Mon Sep 17 00:00:00 2001 From: Etienne Rey-bethbeder Date: Mon, 13 Mar 2023 15:12:23 +0100 Subject: [PATCH] Fixed Armand, essaye de trouver un autre bug, BOZO --- builtins/cd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/builtins/cd.c b/builtins/cd.c index a3a34ef..5ef897d 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/13 13:26:08 by erey-bet ### ########.fr */ +/* Updated: 2023/03/13 15:11:07 by erey-bet ### ########.fr */ /* */ /* ************************************************************************** */ @@ -38,6 +38,11 @@ int move_folder(char **args, int fd) return (1); } path = args[0]; + if (!path) + { + write(2, "No such file or directory\n", 26); + return (1); + } if (path[0] == '/' || ft_strncmp(path, "..", ft_strlen(path)) == 0) { if (chdir(path) == 0)