diff options
Diffstat (limited to 'src/c_init.c')
-rw-r--r-- | src/c_init.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/c_init.c b/src/c_init.c index 7ea11ac..2718ac8 100644 --- a/src/c_init.c +++ b/src/c_init.c @@ -81,6 +81,11 @@ static int16_t return (c_end_key(ft_strlen(line), plen, tcaps)); else if ((*((unsigned int *)buf)) == CTRL_L) return (c_ctrl_l(line, tcaps, msh)); + else if ((*((unsigned int *)buf)) == CTRL_C) + { + msh->ret = 130; + return (1); + } else return (0); } @@ -108,7 +113,10 @@ static char c_redraw_line(line, tcaps, msh); } else - c_read_cap(buf, line, tcaps, msh); + if (c_read_cap(buf, line, tcaps, msh) == 130) + { + return (c_new_line(ft_strdup("\n"), tcaps)); + } if (buf[0] == '\n') return (c_new_line(line, tcaps)); return (NULL); @@ -133,6 +141,11 @@ int16_t return (-1); while (!(ft_strchr(nread, '\n'))) { + if (msh->ret == 130) + { + *line = ft_strdup("\0"); + return (1); + } ft_bzero(nread, 5); if (!(read(fd, nread, 4))) return (0); |