tests heredocs

This commit is contained in:
hugogogo
2021-12-03 07:01:20 +01:00
parent 687b1d8631
commit 294a818924
5 changed files with 12 additions and 122 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/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);