summaryrefslogtreecommitdiffstats
path: root/src/c_input.c
diff options
context:
space:
mode:
authorsalad <fmoenne-@student.le-101.fr>2020-09-21 16:11:33 +0200
committersalad <fmoenne-@student.le-101.fr>2020-09-21 16:11:33 +0200
commitfd7a2ba757e6382ce377e9f53fcff0c483099caa (patch)
tree6d5235b58ffa7466cb8d54a9573b3f9ef09c169d /src/c_input.c
parentlets fucking go (diff)
download42-minishell-fd7a2ba757e6382ce377e9f53fcff0c483099caa.tar.gz
42-minishell-fd7a2ba757e6382ce377e9f53fcff0c483099caa.tar.bz2
42-minishell-fd7a2ba757e6382ce377e9f53fcff0c483099caa.tar.xz
42-minishell-fd7a2ba757e6382ce377e9f53fcff0c483099caa.tar.zst
42-minishell-fd7a2ba757e6382ce377e9f53fcff0c483099caa.zip
DEL MULTILIGNEED
Diffstat (limited to 'src/c_input.c')
-rw-r--r--src/c_input.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/c_input.c b/src/c_input.c
index be72aa9..37f7b66 100644
--- a/src/c_input.c
+++ b/src/c_input.c
@@ -66,7 +66,7 @@ c_get_line_num(char *line,
it = 0;
line_num = 0;
- tcaps->lpos = 0;
+ tcaps->lpos = 1;
len = ft_strlen(line);
if (len < (tcaps->ws.ws_col - plen))
return (1);
@@ -81,9 +81,23 @@ c_get_line_num(char *line,
int16_t
c_back_slash(char **line,
- t_caps *tcaps)
+ uint32_t plen,
+ t_caps *tcaps)
{
- if (tcaps->cpos >= 1)
+ int32_t pos;
+
+ pos = -1;
+ if (((tcaps->cpos + plen) % (tcaps->ws.ws_col)) == 0
+ && tcaps->cpos >= 1)
+ {
+ *line = c_delchar(*line, tcaps->cpos);
+ tputs(tgetstr("up", NULL), 1, ft_putchar);
+ while(++pos <= (tcaps->ws.ws_col))
+ tputs(tgetstr("nd", NULL), 1, ft_putchar);
+ tputs(tgetstr("dc", NULL), 1, ft_putchar);
+ tcaps->cpos--;
+ }
+ else if (tcaps->cpos >= 1)
{
*line = c_delchar(*line, tcaps->cpos);
tcaps->cpos--;