/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* builtin_unsetenv.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/28 14:29:17 by jhalford #+# #+# */ /* Updated: 2016/12/03 11:55:53 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ #include "minishell.h" int builtin_unsetenv(const char *path, char *const av[], char *const envp[]) { int i; int j; char ***env; (void)envp; (void)path; env = &data_singleton()->env; i = 1; while (av[i]) { j = 0; while ((*env)[j]) { if (ft_strcmp((*env)[j], av[i]) == '=') ft_sstrdel(*env, j); else j++; } i++; } return (0); }