fix: heredoc signal

This commit is contained in:
Camille Chauvet
2023-04-05 14:13:56 +02:00
parent fe535a21f0
commit 404fcaa15f
4 changed files with 34 additions and 12 deletions

View File

@ -6,7 +6,7 @@
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/28 15:59:01 by cchauvet #+# #+# */
/* Updated: 2023/03/28 16:09:37 by cchauvet ### ########.fr */
/* Updated: 2023/04/05 14:09:39 by alouis-j ### ########.fr */
/* */
/* ************************************************************************** */
@ -30,7 +30,8 @@ void ft_ctrlc(int num)
data->exit_code = 130;
if (*ft_get_heredoc() != -1)
{
close(*ft_get_heredoc());
if (*ft_get_heredoc() > 2)
close(*ft_get_heredoc());
*ft_get_heredoc() = -1;
}
else