-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathunset.c
35 lines (32 loc) · 1.19 KB
/
unset.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* unset.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: wonyang <wonyang@student.42seoul.kr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/01/09 14:05:36 by wonyang #+# #+# */
/* Updated: 2023/01/13 21:51:12 by wonyang ### ########seoul.kr */
/* */
/* ************************************************************************** */
#include "ds_envp.h"
#include "return.h"
int ft_unset(char **argv, t_envp *envp)
{
int i;
t_error errno;
if (!argv || !(*argv))
{
printf("ft_unset argument error!\n");
return (1);
}
i = 0;
while (argv[i])
{
errno = del_key_enode(envp, argv[i]);
if (errno == ERROR)
return (1);
i++;
}
return (0);
}