diff options
author | salad <fmoenne-@student.le-101.fr> | 2020-09-17 15:58:05 +0200 |
---|---|---|
committer | salad <fmoenne-@student.le-101.fr> | 2020-09-17 15:58:05 +0200 |
commit | 695bfa914d789345fa524395f59a7c6a96122eeb (patch) | |
tree | b52ee269173e0745d97ff70378e975e27c45e9a8 /src/c_utils.c | |
parent | heh (diff) | |
download | 42-minishell-695bfa914d789345fa524395f59a7c6a96122eeb.tar.gz 42-minishell-695bfa914d789345fa524395f59a7c6a96122eeb.tar.bz2 42-minishell-695bfa914d789345fa524395f59a7c6a96122eeb.tar.xz 42-minishell-695bfa914d789345fa524395f59a7c6a96122eeb.tar.zst 42-minishell-695bfa914d789345fa524395f59a7c6a96122eeb.zip |
multiligne prototype et plus de leaks
Diffstat (limited to 'src/c_utils.c')
-rw-r--r-- | src/c_utils.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/c_utils.c b/src/c_utils.c index b50280d..35c95ef 100644 --- a/src/c_utils.c +++ b/src/c_utils.c @@ -24,13 +24,11 @@ /* ** TODO: -** leaks on line +** MULTILIGHNE ** quotes ** C-c ** NORME -** MULTILIGHNE -** term(0) on exit DONE -** cursor on char insert DONE +** leaks on line ??? GONE ? */ int16_t @@ -171,8 +169,22 @@ int16_t int16_t ret; i = 0; - tputs(tgetstr("cr", NULL), 1, ft_putchar); len = ft_strlen(line); + tputs(tgetstr("cr", NULL), 1, ft_putchar); + if (len >= (tcaps->ws.ws_col - ft_strlen(msh->ps[0]))) + { + if (len == (tcaps->ws.ws_col - ft_strlen(msh->ps[0]))) + { + tputs(tgetstr("sf", NULL), 1, ft_putchar); + return (1); + } + else + { + tputs(tgetstr("sf", NULL), 1, ft_putchar); + tputs(tgetstr("up", NULL), 1, ft_putchar); + tputs(tgetstr("up", NULL), 1, ft_putchar); + } + } while (i < ft_strlen(msh->ps[0])) { tputs(tgetstr("nd", NULL), 1, ft_putchar); |