Fix duplicate letter on perfect match

This commit is contained in:
M600 2017-02-16 16:38:03 +01:00
parent f1808b39c6
commit 7a35430c5c
3 changed files with 14 additions and 6 deletions

View file

@ -6,7 +6,7 @@
/* By: alao <alao@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/01/09 13:31:21 by alao #+# #+# */
/* Updated: 2017/02/16 12:04:10 by alao ### ########.fr */
/* Updated: 2017/02/16 16:31:34 by alao ### ########.fr */
/* */
/* ************************************************************************** */
@ -21,6 +21,7 @@
static int c_exclusion_folder(t_comp *c)
{
DG("Exclusion");
DIR *rep;
char *tmp;
@ -35,6 +36,8 @@ static int c_exclusion_folder(t_comp *c)
data_singleton()->line.input = ft_strdup(tmp);
data_singleton()->line.pos = data_singleton()->line.pos + 1;
c->isfolder = 1;
tmp ? ft_memdel((void *)&tmp) : (0);
return (1);
}
tmp ? ft_memdel((void *)&tmp) : (0);
return (0);

View file

@ -6,7 +6,7 @@
/* By: alao <alao@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/01/09 13:52:07 by alao #+# #+# */
/* Updated: 2017/02/03 17:35:47 by jhalford ### ########.fr */
/* Updated: 2017/02/16 16:32:44 by alao ### ########.fr */
/* */
/* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: alao <alao@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/02/15 12:03:30 by alao #+# #+# */
/* Updated: 2017/02/16 16:21:02 by alao ### ########.fr */
/* Updated: 2017/02/16 16:37:35 by alao ### ########.fr */
/* */
/* ************************************************************************** */
@ -51,17 +51,22 @@ int c_rematch(t_comp *c, long int keypress)
if (ft_isascii(keypress))
{
c_term_clear(c);
ft_print(keypress);
c_refresh_match(c, keypress);
c_clear_lst(c);
c->lst = NULL;
if (c_matching(data_singleton(), c))
return (1);
c_matching(data_singleton(), c);
if (c->lst == NULL)
{
c_clear(data_singleton());
return (1);
}
else if (c->lst == c->lst->next)
return (1);
else
{
ft_print(keypress);
return(1);
}
}
return (0);
}