Repository navigation
Expand file tree
/
Copy pathutils5.c
More file actions
49 lines (44 loc) · 1.4 KB
/
Copy pathutils5.c
File metadata and controls
49 lines (44 loc) · 1.4 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* utils5.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aouchaad <aouchaad@student.1337.ma> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/06/22 18:01:10 by aouchaad #+# #+# */
/* Updated: 2023/06/22 18:17:43 by aouchaad ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
void env_exp_free(t_environment_path *envp, t_environment_path *exp)
{
t_environment_path *tmp;
while (envp)
{
free_pointer(&(envp->valeur));
free_pointer(&(envp->variable));
tmp = envp->next;
free(envp);
envp = tmp;
}
while (exp)
{
free_pointer(&(exp->valeur));
free_pointer(&(exp->variable));
tmp = exp->next;
free(exp);
exp = tmp;
}
}
int only_spaces(char *input)
{
int i;
i = 0;
while (input[i])
{
if (input[i] != ' ' && input[i] != '\t')
return (0);
i++;
}
return (1);
}