shell_script()

+ reset "rl_event_hook" to NULL after here_doc()
+ split init.c in multiple files
+ submodule minishell_tests
This commit is contained in:
LuckyLaszlo
2021-12-18 05:42:08 +01:00
parent fa71189132
commit afbb1cd2e0
11 changed files with 226 additions and 82 deletions

View File

@@ -6,7 +6,7 @@
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/10/04 05:59:26 by lperrey #+# #+# */
/* Updated: 2021/12/01 14:45:04 by lperrey ### ########.fr */
/* Updated: 2021/12/18 03:24:54 by lperrey ### ########.fr */
/* */
/* ************************************************************************** */
@@ -21,8 +21,7 @@ void shell_loop(t_all *c)
line_input = NULL;
while (1)
{
if (line_input)
free(line_input);
free(line_input);
line_input = read_input(c->prompt, c);
if (line_input && *line_input)
{
@@ -48,6 +47,7 @@ static char *read_input(char *prompt, t_all *c)
ft_bzero(&signal_behaviour, sizeof signal_behaviour);
signal_behaviour.sa_handler = sigint_handler_interactive;
sigaction(SIGINT, &signal_behaviour, NULL);
rl_event_hook = NULL;
line_input = readline(prompt);
signal_behaviour.sa_handler = SIG_IGN;
sigaction(SIGINT, &signal_behaviour, NULL);