summaryrefslogtreecommitdiffstats
path: root/src/c_utils.c
diff options
context:
space:
mode:
authorSalad <water_appreciator@protonmail.com>2020-09-25 16:48:16 +0200
committerSalad <water_appreciator@protonmail.com>2020-09-25 16:48:16 +0200
commite6d868ff05462d4a4ea7f8c6ff50fd2b3aea2359 (patch)
tree5c17c204e6f37d5eed5e16ca5a74842573799038 /src/c_utils.c
parenthome improvement (diff)
download42-minishell-e6d868ff05462d4a4ea7f8c6ff50fd2b3aea2359.tar.gz
42-minishell-e6d868ff05462d4a4ea7f8c6ff50fd2b3aea2359.tar.bz2
42-minishell-e6d868ff05462d4a4ea7f8c6ff50fd2b3aea2359.tar.xz
42-minishell-e6d868ff05462d4a4ea7f8c6ff50fd2b3aea2359.tar.zst
42-minishell-e6d868ff05462d4a4ea7f8c6ff50fd2b3aea2359.zip
transfert
Diffstat (limited to 'src/c_utils.c')
-rw-r--r--src/c_utils.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/c_utils.c b/src/c_utils.c
index de71ef3..834f192 100644
--- a/src/c_utils.c
+++ b/src/c_utils.c
@@ -24,10 +24,11 @@
/*
** TODO:
-** REPRINT edit
+** delchar MOVE
+** END MONGARS
+** NORME
** FLECHES UP DOWN
** C-c globul pid
-** NORME
*/
uint16_t
@@ -132,10 +133,9 @@ int16_t
uint32_t len;
uint32_t mod;
int16_t ret;
- uint32_t nlines;
i = 0;
- nlines = c_get_line_num(line, tcaps->cpos, ft_strlen(msh->ps[0]), tcaps);
+ tcaps->nlines = c_get_line_num(line, tcaps->cpos, ft_strlen(msh->ps[0]), tcaps);
len = ft_strlen(line);
mod = (tcaps->ws.ws_col);
tputs(tgetstr("cr", NULL), 1, ft_putchar);
@@ -155,14 +155,14 @@ int16_t
tputs(tgetstr("nd", NULL), 1, ft_putchar);
i++;
}
- nlines = c_get_line_num(line, tcaps->cpos, ft_strlen(msh->ps[0]), tcaps);
+ tcaps->nlines = c_get_line_num(line, tcaps->cpos, ft_strlen(msh->ps[0]), tcaps);
ret = ft_printf("%s", line);
- i = (nlines == (tcaps->lpos)) ? 0 : tcaps->ws.ws_col * (tcaps->lpos - 1);
+ i = (tcaps->nlines == (tcaps->lpos)) ? 0 : tcaps->ws.ws_col * (tcaps->lpos - 1);
if (tcaps->cpos != len)
{
- if (nlines != tcaps->lpos)
+ if (tcaps->nlines != tcaps->lpos)
{
- while (--nlines > tcaps->lpos)
+ while (--tcaps->nlines > tcaps->lpos)
tputs(tgetstr("up", NULL), 1, ft_putchar);
tputs(tgetstr("up", NULL), 1, ft_putchar);
tputs(tgetstr("cr", NULL), 1, ft_putchar); /* cr, cpos mauvaise col, bonne ligne */