/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* heredoc.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: cchauvet "); line = get_next_line(*ft_get_heredoc()); while (line != NULL) { line[ft_strlen(line) - 1] = '\0'; if (ft_strcmp(line, stop) == 0) { free(line); break ; } line_clean = ft_env_filler(data, line); free(line); ft_putendl_fd(line_clean, fds[1]); free(line_clean); ft_printf("> "); line = get_next_line(*ft_get_heredoc()); if (line == NULL && *ft_get_heredoc() == -1) { close(fds[0]); close(fds[1]); return (-2); } } close(fds[1]); *ft_get_heredoc() = -1; return (fds[0]); }