signaux fonctionnent sur test

This commit is contained in:
hugogogo
2021-11-15 16:09:19 +01:00
parent 47ae67ed14
commit 57c271b9e2
4 changed files with 65 additions and 9 deletions

View File

@@ -3,8 +3,21 @@
int builtin_unset(int argc, char *argv[], t_all *c)
{
int position;
(void)argc;
(void)argv;
(void)c;
position = getenv_position(c->envp, argv[1]);
if (position == -1)
return (0);
while (c->envp[position])
{
write(1, "1", 1);
free(c->envp[position]);
c->envp[position] = ft_strdup(c->envp[position + 1]);
position++;
}
write(1, "2", 1);
free(c->envp[position]);
return (0);
}