des trucs

This commit is contained in:
2024-04-23 17:03:30 +02:00
parent 905bbc659b
commit 2d8624d221
5 changed files with 20 additions and 19 deletions

View File

@ -6,7 +6,7 @@
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/22 14:31:13 by tomoron #+# #+# */
/* Updated: 2024/04/22 19:53:34 by marde-vr ### ########.fr */
/* Updated: 2024/04/23 16:59:02 by tomoron ### ########.fr */
/* */
/* ************************************************************************** */
@ -26,29 +26,26 @@ void signal_handler_interactive(int signum)
printf("%s%s", rl_prompt, rl_line_buffer);
}
void *here_doc_variables(int write, int index, void *data)
void *here_doc_variables(int write, void *data)
{
static void *variables[2];
static void *variable;
if (write)
variables[index] = data;
variables = data;
else
return (variables[index]);
return (variables);
return (0);
}
void signal_handler_here_doc(int signum)
{
t_msh *msh;
char *here_doc_file;
if (signum == SIGINT)
{
printf("%s%s^C\n", rl_prompt, rl_line_buffer);
msh = here_doc_variables(0, 0, 0);
here_doc_file = here_doc_variables(0, 1, 0);
msh = here_doc_variables(0, 0);
close(msh->in_fd);
free(here_doc_file);
ft_exit(msh, 1);
}
}