25 lines
377 B
C
25 lines
377 B
C
|
|
#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 = ft_getenv_position(argv[i]);
|
|
free(environ[env_position]);
|
|
while (environ[env_position])
|
|
{
|
|
environ[env_position] = environ[env_position + 1];
|
|
env_position++;
|
|
}
|
|
i++;
|
|
}
|
|
return (0);
|
|
}
|