diff options
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); |