fix: heredoc ctrl + d close fd
This commit is contained in:
parent
68c945ae05
commit
88d955fddc
@ -6,7 +6,7 @@
|
||||
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/02/17 15:36:26 by cchauvet #+# #+# */
|
||||
/* Updated: 2023/03/31 15:25:13 by alouis-j ### ########.fr */
|
||||
/* Updated: 2023/03/31 15:28:31 by alouis-j ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -38,7 +38,10 @@ static int ft_heredoc2(t_data *data, char *stop, int fds[2])
|
||||
ft_printf("> ");
|
||||
line = get_next_line(*ft_get_heredoc());
|
||||
if (line == NULL)
|
||||
{
|
||||
ft_closer(fds);
|
||||
return (1);
|
||||
}
|
||||
line[ft_strlen(line) - 1] = '\0';
|
||||
if (ft_strcmp(line, stop) == 0)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user