-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain_2.c
More file actions
39 lines (36 loc) · 1.35 KB
/
main_2.c
File metadata and controls
39 lines (36 loc) · 1.35 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main_2.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mamoussa <mamoussa@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/12/11 11:56:34 by mamoussa #+# #+# */
/* Updated: 2020/12/11 12:23:48 by mamoussa ### ########.fr */
/* */
/* ************************************************************************** */
#include "shell.h"
void main_2(char *line)
{
free(line);
line = NULL;
ft_lstclearenv(&g_env_head);
if (g_tmp_cmd)
ft_lstclearcmd(&g_tmp_cmd);
if (g_tmp_env)
double_pointer_free(g_tmp_env);
}
void main_3(char *line)
{
g_tmp_cmd = g_cmd_head;
if (g_tmp_cmd && (syntax_error(g_tmp_cmd)) && (swap_lst(&g_tmp_cmd))
&& (add_echo(&g_tmp_cmd)))
{
g_cmd_head = g_tmp_cmd;
ft_execution(line, g_tmp_cmd);
}
if (g_tmp_cmd)
ft_lstclearcmd(&g_tmp_cmd);
free(g_buff);
g_buff = NULL;
}