-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
39 lines (36 loc) · 1.3 KB
/
main.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
/* ************************************************************************** */
/* */
/* :::::::: */
/* main.c :+: :+: */
/* +:+ */
/* By: tiemen <[email protected]> +#+ */
/* +#+ */
/* Created: 2020/10/26 12:50:24 by tiemen #+# #+# */
/* Updated: 2021/02/05 12:36:18 by gbouwen ######## odam.nl */
/* */
/* ************************************************************************** */
#include "minishell.h"
int main(int ac, char **av, char **envp)
{
int status;
t_data data;
if (ac != 1)
{
ft_printf("%s doesn't work with arguments.\n", av[0]);
return (0);
}
ignore_signals();
status = 1;
g_in_parent = 1;
g_prompt = 0;
g_work_dir = NULL;
initialize_data(&data, envp);
while (status == 1)
{
g_c_signal = 0;
g_work_dir = get_work_dir_prompt();
prompt();
status = executer(&data);
}
return (0);
}