Browse Source

fix too many args for cd

master
narnaud 3 years ago
parent
commit
84d274056a
  1. 4
      built-in.c

4
built-in.c

@ -6,7 +6,7 @@
/* By: mea <mea@student.42.fr> +#+ +:+ +#+ */ /* By: mea <mea@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2022/01/06 09:02:57 by narnaud #+# #+# */ /* 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; char *home;
if (cmd->argc > 1)
return (cmd_error("cd", "too many arguments"));
if (cmd->argv[1]) if (cmd->argv[1])
{ {
if (access(cmd->argv[1], X_OK)) if (access(cmd->argv[1], X_OK))

Loading…
Cancel
Save