diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-04-23 20:39:56 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-04-23 20:39:56 +0200 |
commit | 15587099afed656c597eddec84e342831c00508f (patch) | |
tree | b1799f588fcd8aff27c0320f3057ebf44da24ea1 /src/ft_b_cd.c | |
parent | pwd is bav (diff) | |
download | 42-minishell-15587099afed656c597eddec84e342831c00508f.tar.gz 42-minishell-15587099afed656c597eddec84e342831c00508f.tar.bz2 42-minishell-15587099afed656c597eddec84e342831c00508f.tar.xz 42-minishell-15587099afed656c597eddec84e342831c00508f.tar.zst 42-minishell-15587099afed656c597eddec84e342831c00508f.zip |
On the way
Diffstat (limited to 'src/ft_b_cd.c')
-rw-r--r-- | src/ft_b_cd.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/ft_b_cd.c b/src/ft_b_cd.c index c0bf04b..eedb1c2 100644 --- a/src/ft_b_cd.c +++ b/src/ft_b_cd.c @@ -11,14 +11,24 @@ /* ************************************************************************** */ #include <stdint.h> +#include <unistd.h> + #include "ft_s_struct.h" +#include "ft_u_utils.h" uint8_t ft_b_cd(char *args[], t_msh *msh) { - (void)args; + char *path; + (void)msh; + if (!args) + { + path = ft_get_home_dir(msh); + chdir(); + ft_memdel((void*)&path); + } /* TODO: do cd */ return (0); } |