des trucs
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user