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

33
srcs/init/init_readline.c Normal file
View File

@@ -0,0 +1,33 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* init_readline.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/10/08 09:22:12 by lperrey #+# #+# */
/* Updated: 2021/12/18 04:31:59 by lperrey ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
static int init_readline_hook(void);
void init_readline(void)
{
rl_outstream = stderr;
rl_startup_hook = init_readline_hook;
readline(NULL);
rl_startup_hook = NULL;
}
/*
** set rl_startup_hook with this, for init COLUMNS and LINES variables
** and prevent leak/double_free with **environ
*/
static int init_readline_hook(void)
{
rl_done = 1;
return (0);
}