/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* b_pwd.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: rbousset +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/14 17:19:27 by rbousset #+# #+# */ /* Updated: 2020/02/14 17:19:29 by rbousset ### ########lyon.fr */ /* */ /* ************************************************************************** */ #include #include #include #include "s_struct.h" uint8_t b_pwd(char *args[], t_msh *msh) { char *tmp; if (args[0] != NULL && ft_strncmp(args[0], "-P", 3) == 0) { tmp = getcwd(NULL, 0); ft_printf("%s\n", tmp); ft_memdel((void*)&tmp); return (0); } ft_printf("%s\n", msh->cwd); return (0); }