From 316194d8609fbece9c16d3e71ab360acbfd08712 Mon Sep 17 00:00:00 2001 From: gwojda Date: Wed, 22 Mar 2017 14:25:05 +0100 Subject: [PATCH] fix de quelques problemes sur la completion qui tranaient... --- 42sh/src/completion/c_init.c | 4 +--- 42sh/src/completion/c_match.c | 6 +----- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/42sh/src/completion/c_init.c b/42sh/src/completion/c_init.c index 3cfd34ca..5277f08e 100644 --- a/42sh/src/completion/c_init.c +++ b/42sh/src/completion/c_init.c @@ -6,7 +6,7 @@ /* By: alao +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/01/09 11:21:16 by alao #+# #+# */ -/* Updated: 2017/03/21 11:39:22 by gwojda ### ########.fr */ +/* Updated: 2017/03/22 14:21:51 by gwojda ### ########.fr */ /* */ /* ************************************************************************** */ @@ -36,8 +36,6 @@ static char *c_trimmer(char *cmd, int st, int nd) rt = ft_strsub(cmd, st, nd - st); data_singleton()->comp->cutpoint = st; st = 0; - while (rt[st] == ' ') - st++; tmp = ft_strsub(rt, st, ft_strlen(rt) - st); if (st) data_singleton()->comp->between = ft_strsub(rt, 0, st); diff --git a/42sh/src/completion/c_match.c b/42sh/src/completion/c_match.c index e3f7b7ba..c328e604 100644 --- a/42sh/src/completion/c_match.c +++ b/42sh/src/completion/c_match.c @@ -6,7 +6,7 @@ /* By: alao +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/10/15 13:27:14 by alao #+# #+# */ -/* Updated: 2017/03/22 12:58:21 by gwojda ### ########.fr */ +/* Updated: 2017/03/22 14:21:45 by gwojda ### ########.fr */ /* */ /* ************************************************************************** */ @@ -43,12 +43,8 @@ static int c_chevron(t_comp *c) static char *c_current_words(t_comp *c) { size_t pos; - size_t input_len; pos = c->ircmd; - input_len = ft_strlen(data_singleton()->line.input); - if (pos >= ft_strlen(c->rcmd)) - pos = ft_strlen(c->rcmd) - (input_len - pos + 1); while (pos && c->rcmd[pos] != ' ' && c->rcmd[pos] != '<' && c->rcmd[pos] != '>' && c->rcmd[pos] != '\n') --pos;