-
Notifications
You must be signed in to change notification settings - Fork 0
/
min_print.c
executable file
·55 lines (50 loc) · 1.42 KB
/
min_print.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* min_print.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: potero <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/06/09 16:22:29 by potero #+# #+# */
/* Updated: 2022/08/03 11:00:31 by potero-d ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
void print_env(t_myenv **myenv)
{
int i;
t_myenv *aux;
i = 0;
aux = *myenv;
while (aux)
{
if (ft_strcmp(aux->key, "?") == 0)
aux = aux->next;
else
{
if (aux->value != 0)
printf("%s=%s\n", aux->key, aux->value);
aux = aux->next;
}
}
}
void print_list(t_argv **argv)
{
int w;
int i;
t_argv *aux;
w = 0;
aux = *argv;
while (aux)
{
i = 0;
printf("arg[%d]->%s\n", w, aux->arg);
while (aux->split[i])
{
printf("\ts[%d]->%s\n", i, aux->split[i]);
i++;
}
w++;
aux = aux->next;
}
}