-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathminishell.c
39 lines (35 loc) · 1.35 KB
/
minishell.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* minishell.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: anlima <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/06/07 20:47:34 by anlima #+# #+# */
/* Updated: 2023/10/24 19:19:04 by anlima ### ########.fr */
/* */
/* ************************************************************************** */
#include "./include/minishell.h"
int g_exit = 0;
int main(int argc, char **argv, char **env)
{
(void)(argc);
(void)(argv);
init_program(env);
while (1)
{
rl_on_new_line();
term()->command = readline(PROMPT);
if (term()->command == NULL)
break ;
if (*term()->command == '\0')
continue ;
lexer();
add_history(term()->command);
clean_mallocs();
remove(HERETXT);
}
free_env();
return (0);
}
// TODO: - ctrl c in child process prints minishell twice, fix it