diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-08-17 18:12:18 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-08-17 18:12:18 +0200 |
commit | 598c360d22fa9b3c863f74bb6280472fd805fa0d (patch) | |
tree | 0f4da458afd6ee66a9aa203df459e061970de5a1 /src/b_cd.c | |
parent | Set libft/ft_is* to type t_bool (diff) | |
download | 42-minishell-598c360d22fa9b3c863f74bb6280472fd805fa0d.tar.gz 42-minishell-598c360d22fa9b3c863f74bb6280472fd805fa0d.tar.bz2 42-minishell-598c360d22fa9b3c863f74bb6280472fd805fa0d.tar.xz 42-minishell-598c360d22fa9b3c863f74bb6280472fd805fa0d.tar.zst 42-minishell-598c360d22fa9b3c863f74bb6280472fd805fa0d.zip |
Fixed unset not working
Diffstat (limited to 'src/b_cd.c')
-rw-r--r-- | src/b_cd.c | 15 |
1 files changed, 5 insertions, 10 deletions
@@ -32,14 +32,6 @@ static void { f_alloc_and_destroy_msh(msh); } - if (ft_strncmp("~/", *path, 2) == 0 || !ft_strncmp("~", *path, 2)) - { - if (!(*path = ft_strsubst(*path, - "~", u_get_var_value("$HOME", msh)))) - { - f_alloc_and_destroy_msh(msh); - } - } } static void @@ -142,8 +134,11 @@ uint8_t } else if (argc == 0) { - if (!(path = u_get_var_value("$HOME", msh))) - return (1); + if ((path = u_get_var_value("$HOME", msh)) == NULL) + { + ft_dprintf(STDERR_FILENO, "minishell: cd: HOME not set\n"); + return (2); + } } else set_path(&path, args, msh); |