
#include "minishell.h"

int	builtin_unset(int argc, char *argv[], t_all *c)
{
	int			env_position;
	int			i;

	(void)argc;
	(void)c;
	i = 1;
	while (argv[i])
	{
		env_position = getenv_position(environ, argv[i]);
		free(environ[env_position]);
		while (environ[env_position])
		{
			environ[env_position] = environ[env_position + 1];
			env_position++;
		}
		i++;
	}
	return (0);
}
