summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorsalad <fmoenne-@student.le-101.fr>2020-09-08 14:21:41 +0200
committersalad <fmoenne-@student.le-101.fr>2020-09-08 14:21:41 +0200
commit112487d69261e508c12a2b761a83a287355e2c0d (patch)
tree2921d3920e4f90accf2eb09160480a0886c8cb96 /src
parentdelchar in progress (diff)
download42-minishell-112487d69261e508c12a2b761a83a287355e2c0d.tar.gz
42-minishell-112487d69261e508c12a2b761a83a287355e2c0d.tar.bz2
42-minishell-112487d69261e508c12a2b761a83a287355e2c0d.tar.xz
42-minishell-112487d69261e508c12a2b761a83a287355e2c0d.tar.zst
42-minishell-112487d69261e508c12a2b761a83a287355e2c0d.zip
on god?
Diffstat (limited to '')
-rw-r--r--src/c_init.c1
-rw-r--r--src/c_input.c7
2 files changed, 5 insertions, 3 deletions
diff --git a/src/c_init.c b/src/c_init.c
index 0044f98..454e70a 100644
--- a/src/c_init.c
+++ b/src/c_init.c
@@ -134,6 +134,7 @@ int16_t
else if (strncmp(buf, tgetstr("kb", NULL), ft_strlen(tgetstr("kb", NULL))) == 0)
{
line = c_delchar(line, tcaps->cpos);
+ tcaps->cpos -= 1;
tputs(tgetstr("le", NULL), 1, ft_putchar);
tputs(tgetstr("dc", NULL), 1, ft_putchar);
return (1);
diff --git a/src/c_input.c b/src/c_input.c
index abe6314..e7a3f44 100644
--- a/src/c_input.c
+++ b/src/c_input.c
@@ -46,7 +46,8 @@ char *c_delchar(char *str, uint16_t cpos)
i = 0;
if (!(dst = malloc((ft_strlen(str)) * sizeof(char))))
return (NULL);
- ft_printf("%d\n", cpos);
+ cpos -= 1;
+ /* ft_printf("[%c] [%d]\n", str[cpos], cpos); */
while (j < (ft_strlen(str) - 1))
{
if (i == cpos)
@@ -56,7 +57,7 @@ char *c_delchar(char *str, uint16_t cpos)
j++;
}
dst[j] = '\0';
- ft_printf("dst : [%s]\n", dst);
+ /* ft_printf("dst : [%s]\n", dst); */
return (dst);
}
@@ -76,6 +77,6 @@ int16_t
tputs(tgetstr("nd", NULL), 1, ft_putchar);
i++;
}
- ret = ft_printf("%s, %hu", line, cpos) + ft_strlen(msh->ps[0]);
+ ret = ft_printf("%s", line) + ft_strlen(msh->ps[0]);
return (ret);
}