diff options
Diffstat (limited to 'src/c_init.c')
-rw-r--r-- | src/c_init.c | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/src/c_init.c b/src/c_init.c index 434f456..93f6bb3 100644 --- a/src/c_init.c +++ b/src/c_init.c @@ -145,53 +145,14 @@ char *c_set_ptr(t_bool reset, char key, t_msh *msh) return (p); } -static void - c_add_char(char **line, char *buf, t_caps *tcaps) -{ - int i; - size_t j; - size_t len; - char *dst; - - i = -1; - j = 0; - len = (ft_strlen(*line) + 2); - if (!(dst = (char*)malloc((len) * sizeof(char)))) - return ; - while (++i < (int)len) - { - if (i == (int)tcaps->cpos) - dst[i] = buf[0]; - else - { - dst[i] = line[0][j]; - j++; - } - } - dst[len - 1] = '\0'; - ft_memdel((void**)&line[0]); - *line = ft_strdup(dst); - ft_memdel((void**)&dst); - tcaps->cpos++; - if ((((tcaps->cpos) + tcaps->plen) % - tcaps->ws.ws_col) == 0) - { - write(STDOUT_FILENO, "\n\r", 2); - return ; - } - c_redraw_line(*line, tcaps); -} - static char *c_process_key(char **line, char *buf, t_caps *tcaps, t_msh *msh) { char *ptr; if (*line == NULL) - { if (!(*line = calloc(1, sizeof(char)))) return (NULL); - } if (ft_isprint(buf[0])) c_add_char(line, buf, tcaps); else if (((*((unsigned int *)buf)) == UP_K) || @@ -213,9 +174,7 @@ static char c_back_slash(line, tcaps->plen, tcaps); if ((((tcaps->cpos) + tcaps->plen) % tcaps->ws.ws_col) == 0) - { return (NULL); - } c_redraw_line(*line, tcaps); } else if ((*((unsigned int *)buf)) == CTRL_C) |