Commit 604cbb0f authored by abenoit's avatar abenoit
Browse files

print ^C and ^\ does nothing

parent 3a473145
......@@ -6,12 +6,16 @@
static int handle_eof(char **line, int ret)
{
char *tmp;
char *ptr;
while (ret != SUCCESS)
{
ft_putstr_fd(" \b\b", STDIN_FILENO);
ret = get_next_line(STDIN_FILENO, &tmp);
*line = ft_strjoin(*line, tmp);
ptr = *line;
*line = ft_strjoin(ptr, tmp);
free(ptr);
free(tmp);
}
return (ret);
}
......
......@@ -3,27 +3,20 @@
void sig_int(int signum)
{
(void)signum;
// ft_putstr_fd("SIGINT", 1);
ft_putstr_fd("\b\b \b\b", STDOUT_FILENO);
// ft_putstr_fd("\b\b \b\b", STDOUT_FILENO);
ft_putstr_fd("\n", STDOUT_FILENO);
if (ft_putstr_fd(FT_PS1, STDOUT_FILENO) == ERROR)
return ;
// kill(0, signum);
// exit(signum);
// signal(signum, SIG_DFL);
}
void sig_kill(int signum)
{
(void)signum;
// ft_putstr_fd("SIGQUIT", 1);
ft_putstr_fd("\b\b \b\b", STDOUT_FILENO);
ft_putstr_fd("\n", STDOUT_FILENO);
if (ft_putstr_fd(FT_PS1, STDOUT_FILENO) == ERROR)
return ;
// kill(0, signum);
// exit(signum);
// signal(signum, SIG_DFL);
// ft_putstr_fd("\b\b \b\b", STDOUT_FILENO);
// ft_putstr_fd("\n", STDOUT_FILENO);
// if (ft_putstr_fd(FT_PS1, STDOUT_FILENO) == ERROR)
// return ;
}
void signal_handler(void)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment