+ last_exit_status set/get functions for here_doc + TODO : replace all occurences of last_exit_status + **environ fix + builtin_unset() fix
26 lines
407 B
C
26 lines
407 B
C
|
|
#include "minishell.h"
|
|
|
|
int builtin_unset(int argc, char *argv[], t_all *c)
|
|
{
|
|
extern char **environ;
|
|
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);
|
|
}
|