small fixes

This commit is contained in:
Loic Deridder
2025-02-19 10:17:27 +01:00
parent e673be640c
commit ba28816858
4 changed files with 24 additions and 16 deletions

View File

@@ -27,7 +27,10 @@ int exec_cd(char *path, t_ast_n *head)
src = getcwd(NULL, 0);
if (chdir(path) == -1)
{
ft_free(&src);
return (err_msg_cmd("cd", path, strerror(errno), EXIT_FAILURE));
}
dest = getcwd(NULL, 0);
pwd_update(head, src, dest);
return (0);