diff options
Diffstat (limited to 'src/c_init.c')
-rw-r--r-- | src/c_init.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/c_init.c b/src/c_init.c index 2bc0be3..dfb97e3 100644 --- a/src/c_init.c +++ b/src/c_init.c @@ -72,6 +72,7 @@ int16_t i = -1; if (line == NULL) { + ft_printf("qweqwe"); if (!(line = ft_calloc(1, sizeof(char)))) return (-1); } @@ -94,14 +95,6 @@ int16_t { return (c_key_right(ft_strlen(line), tcaps)); } - else if (strncmp(buf, tcaps->CL, 4) == 0) - { - return (c_ctrl_l(line, tcaps, msh)); - } - else if (strncmp(buf, tcaps->CC, 4) == 0) - { - return (c_new_line(buf, NULL, msh, tcaps)); - } else if (strncmp(buf, tcaps->HM, 4) == 0) { return (c_home_key(tcaps)); @@ -110,13 +103,23 @@ int16_t { return (c_end_key(ft_strlen(line), tcaps)); } + else if (strncmp(buf, tcaps->CC, 4) == 0) + { + return (c_new_line(NULL, msh, tcaps)); + } + else if (strncmp(buf, tcaps->CL, 4) == 0) + { + return (c_ctrl_l(line, tcaps, msh)); + } else if (strncmp(buf, tgetstr("kb", NULL), ft_strlen(tgetstr("kb", NULL))) == 0) { return (c_back_slash(&line, tcaps)); } else if (buf[0] == '\n') { - return (c_new_line(buf, &line, msh, tcaps)); + c_new_line(ft_strdup(line), msh, tcaps); + ft_memdel((void**)&line); + return (1); } else return (0); |