diff --git a/42sh/src/completion/c_files.c b/42sh/src/completion/c_files.c index bf548265..941e6ba8 100644 --- a/42sh/src/completion/c_files.c +++ b/42sh/src/completion/c_files.c @@ -6,7 +6,7 @@ /* By: alao +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* 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); diff --git a/42sh/src/completion/c_parser.c b/42sh/src/completion/c_parser.c index 08011808..bca42a13 100644 --- a/42sh/src/completion/c_parser.c +++ b/42sh/src/completion/c_parser.c @@ -6,7 +6,7 @@ /* By: alao +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* 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 */ /* */ /* ************************************************************************** */ diff --git a/42sh/src/completion/c_rematch.c b/42sh/src/completion/c_rematch.c index d0aa9ded..9d92a979 100644 --- a/42sh/src/completion/c_rematch.c +++ b/42sh/src/completion/c_rematch.c @@ -6,7 +6,7 @@ /* By: alao +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* 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); }