summaryrefslogtreecommitdiffstats
path: root/src/c_init.c
diff options
context:
space:
mode:
authorsalad <fmoenne-@student.le-101.fr>2020-09-07 20:13:27 +0200
committersalad <fmoenne-@student.le-101.fr>2020-09-07 20:13:27 +0200
commit3ead2ff516490a87574347c7fd489330d5c7e8a7 (patch)
tree68968ccdddffe2cfd181a644746790261dbbde5d /src/c_init.c
parenthoHOOOOOOOOO (diff)
download42-minishell-3ead2ff516490a87574347c7fd489330d5c7e8a7.tar.gz
42-minishell-3ead2ff516490a87574347c7fd489330d5c7e8a7.tar.bz2
42-minishell-3ead2ff516490a87574347c7fd489330d5c7e8a7.tar.xz
42-minishell-3ead2ff516490a87574347c7fd489330d5c7e8a7.tar.zst
42-minishell-3ead2ff516490a87574347c7fd489330d5c7e8a7.zip
TODO tommorrow
Diffstat (limited to 'src/c_init.c')
-rw-r--r--src/c_init.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/c_init.c b/src/c_init.c
index 9dde271..f4b130d 100644
--- a/src/c_init.c
+++ b/src/c_init.c
@@ -85,7 +85,7 @@ static int16_t
}
int16_t
- c_process_key(t_msh *msh, char *buf)
+ c_process_key(char *buf, t_msh *msh, t_caps *tcaps)
{
int i;
static char *line = NULL;
@@ -129,6 +129,7 @@ int16_t
}
else if (strncmp(buf, tgetstr("kb", NULL), ft_strlen(tgetstr("kb", NULL))) == 0)
{
+ c_delchar(line, tcaps);
tputs(tgetstr("le", NULL), 1, ft_putchar);
tputs(tgetstr("dc", NULL), 1, ft_putchar);
return (1);
@@ -159,7 +160,7 @@ int16_t c_init_tcaps(t_msh *msh)
if (!(read(STDIN_FILENO, nread, 4)))
return (0);
tputs(tgetstr("vi", NULL), 1, ft_putchar);
- ret = c_process_key(msh, nread);
+ ret = c_process_key(nread, msh, &tcaps);
tputs(tgetstr("ve", NULL), 1, ft_putchar);
}
return (1);