From 84d274056a33ea59d54e3f9d85b487b525c2be83 Mon Sep 17 00:00:00 2001 From: narnaud Date: Tue, 17 May 2022 17:35:22 +0200 Subject: [PATCH] fix too many args for cd --- built-in.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/built-in.c b/built-in.c index d843550..f2b38b1 100755 --- a/built-in.c +++ b/built-in.c @@ -6,7 +6,7 @@ /* By: mea +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/01/06 09:02:57 by narnaud #+# #+# */ -/* Updated: 2022/05/17 17:28:52 by narnaud ### ########.fr */ +/* Updated: 2022/05/17 17:31:53 by narnaud ### ########.fr */ /* */ /* ************************************************************************** */ @@ -78,6 +78,8 @@ int ft_cd(t_datas *datas, t_command *cmd) { char *home; + if (cmd->argc > 1) + return (cmd_error("cd", "too many arguments")); if (cmd->argv[1]) { if (access(cmd->argv[1], X_OK))