-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.c
36 lines (32 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: TheTerror <jfaye@student.42lyon.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/07/11 18:15:53 by TheTerror #+# #+# */
/* Updated: 2023/11/03 16:24:48 by TheTerror ### ########lyon.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
int g_global;
int main(int argc, char **argv, char **envp)
{
t_vars *v;
(void) argv;
if (argc > 1)
{
ft_leave(NULL, EXIT_FAILURE, \
"minishell takes no arguments or options", __PRINT);
return (EXIT_FAILURE);
}
v = ft_initvars();
if (!v)
return (EXIT_FAILURE);
if (!ft_setenv(v, envp))
ft_exitmainprocss(v, EXIT_FAILURE);
ft_prompt(v);
ft_exitmainprocss(v, EXIT_SUCCESS);
return (EXIT_SUCCESS);
}