Astuce: écouté Raoult
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
/* By: erey-bet <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/02/20 14:27:36 by erey-bet #+# #+# */
|
||||
/* Updated: 2023/03/13 15:11:07 by erey-bet ### ########.fr */
|
||||
/* Updated: 2023/03/21 13:16:24 by erey-bet ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -32,17 +32,12 @@ int move_folder(char **args, int fd)
|
||||
{
|
||||
char *path;
|
||||
|
||||
if (args[1] != NULL)
|
||||
if (args[1] != NULL || args[0] == NULL)
|
||||
{
|
||||
write(2, "cd: too many argument\n", 22);
|
||||
write(2, "cd: Wrong number's argument\n", 28);
|
||||
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)
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/02/14 14:27:08 by cchauvet #+# #+# */
|
||||
/* Updated: 2023/03/13 13:23:56 by erey-bet ### ########.fr */
|
||||
/* Updated: 2023/03/30 13:04:53 by erey-bet ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
Reference in New Issue
Block a user