-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
44 lines (39 loc) · 1.3 KB
/
main.c
File metadata and controls
44 lines (39 loc) · 1.3 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dbislimi <dbislimi@student.42nice.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/07/22 13:09:00 by dbislimi #+# #+# */
/* Updated: 2024/07/23 16:23:20 by dbislimi ### ########.fr */
/* */
/* ************************************************************************** */
#include "./includes/minishell.h"
void minishell(void)
{
char *str;
while (1)
{
str = readline("minishell> ");
if (str == NULL)
break ;
add_history(str);
free(str);
}
}
int main(int ac, char **av, char **envp)
{
t_env *env;
(void)av;
env = NULL;
if (ac > 1)
{
write(2, "minishell requires no arguments\n", 33);
exit(EXIT_FAILURE);
}
env_init(&env, envp);
set_signal_action();
minishell();
envclear(&env);
}