tests heredocs
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2021/10/08 09:22:12 by lperrey #+# #+# */
|
||||
/* Updated: 2021/12/02 01:38:22 by lperrey ### ########.fr */
|
||||
/* Updated: 2021/12/03 06:55:40 by hulamy ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -18,7 +18,9 @@ static int init_readline_hook(void);
|
||||
int init(t_all *c)
|
||||
{
|
||||
ft_bzero(c, sizeof (*c));
|
||||
// rl_instream = stdin;
|
||||
rl_outstream = stderr;
|
||||
// rl_outstream = stdout;
|
||||
rl_startup_hook = init_readline_hook;
|
||||
readline(NULL);
|
||||
rl_startup_hook = NULL;
|
||||
|
||||
@@ -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/02 17:11:55 by hulamy ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -23,6 +23,9 @@ void shell_loop(t_all *c)
|
||||
{
|
||||
if (line_input)
|
||||
free(line_input);
|
||||
// write(2, c->prompt, ft_strlen(c->prompt));
|
||||
// rl_already_prompted = 1;
|
||||
// line_input = read_input(NULL, c);
|
||||
line_input = read_input(c->prompt, c);
|
||||
if (line_input && *line_input)
|
||||
{
|
||||
@@ -53,7 +56,7 @@ static char *read_input(char *prompt, t_all *c)
|
||||
sigaction(SIGINT, &signal_behaviour, NULL);
|
||||
if (!line_input)
|
||||
{
|
||||
write(1, "exit\n", 5);
|
||||
write(2, "exit\n", 5);
|
||||
exit_free(c, get_last_exit_status());
|
||||
}
|
||||
return (line_input);
|
||||
|
||||
Reference in New Issue
Block a user