fixed double here_doc

This commit is contained in:
mdev9
2024-04-24 10:32:29 +02:00
parent 202c5e8811
commit 8becb3f468
2 changed files with 32 additions and 4 deletions

View File

@ -6,7 +6,7 @@
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/24 17:44:32 by marde-vr #+# #+# */
/* Updated: 2024/04/23 17:07:00 by tomoron ### ########.fr */
/* Updated: 2024/04/24 09:57:20 by marde-vr ### ########.fr */
/* */
/* ************************************************************************** */
@ -68,6 +68,12 @@ void handle_here_doc(t_msh *msh, char *eof)
int pid;
here_doc_file = get_tmp_file_name(msh);
if (msh->here_doc_filename)
{
close(msh->in_fd);
unlink(msh->here_doc_filename);
free(msh->here_doc_filename);
}
msh->here_doc_filename = here_doc_file;
msh->in_fd = open(here_doc_file, O_CREAT | O_RDWR, 0644);
if (msh->in_fd == -1)