diff --git a/42sh/includes/completion.h b/42sh/includes/completion.h index 7d043215..630f5b7b 100644 --- a/42sh/includes/completion.h +++ b/42sh/includes/completion.h @@ -6,7 +6,7 @@ /* By: alao +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/02/18 11:13:04 by alao #+# #+# */ -/* Updated: 2017/02/18 14:35:10 by alao ### ########.fr */ +/* Updated: 2017/03/08 13:34:05 by gwojda ### ########.fr */ /* */ /* ************************************************************************** */ @@ -162,4 +162,10 @@ int c_spacing_clear(t_comp *c); int ft_sstrlen(char **s); char *ft_sstrtostr(char **s, char *sep); +/* +** yolo je mets ca au pif - gwojda +*/ + +int c_exclusion_folder(t_comp *c); + #endif diff --git a/42sh/src/completion/c_files.c b/42sh/src/completion/c_files.c index bfbee103..4586095f 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/17 15:34:30 by alao ### ########.fr */ +/* Updated: 2017/03/08 13:33:13 by gwojda ### ########.fr */ /* */ /* ************************************************************************** */ @@ -20,7 +20,7 @@ ** Returning 1 if success (trigger an update) or 0. */ -static int c_exclusion_folder(t_comp *c) +int c_exclusion_folder(t_comp *c) { DIR *rep; char *tmp; diff --git a/42sh/src/completion/c_init.c b/42sh/src/completion/c_init.c index 7c327de1..d1529e0b 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/02/17 13:44:39 by alao ### ########.fr */ +/* Updated: 2017/03/08 12:18:07 by gwojda ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/42sh/src/completion/c_matching.c b/42sh/src/completion/c_matching.c index cce8fad7..bc639b2d 100644 --- a/42sh/src/completion/c_matching.c +++ b/42sh/src/completion/c_matching.c @@ -6,7 +6,7 @@ /* By: alao +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/10/15 13:27:14 by alao #+# #+# */ -/* Updated: 2017/02/17 12:29:20 by alao ### ########.fr */ +/* Updated: 2017/03/08 13:33:10 by gwojda ### ########.fr */ /* */ /* ************************************************************************** */ @@ -29,9 +29,10 @@ int c_matching(t_data *s, t_comp *c) { if (c->rcmd[0] == '.' || c->rcmd[0] == '/') { - c->rcmd[0] == '.' ? c->cpath = path_solver(c, "./", NULL) : 0; - c->rcmd[0] == '/' ? c->cpath = path_solver(c, "/", NULL) : 0; + c->cpath = ft_strndup(c->rcmd, ft_strrchr(c->rcmd, '/') - c->rcmd + 1); + !c->match ? c->match = ft_strdupi_w(ft_strrchr(c->rcmd, '/') + 1) : 0; c_parser(c, c->cpath, c->match); + c_exclusion_folder(c); } else if (!(ft_strchr(c->rcmd, ' '))) c_seek_binary(s, c); diff --git a/42sh/src/completion/c_parser.c b/42sh/src/completion/c_parser.c index 304c6611..d8cb5f2b 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/17 15:34:57 by alao ### ########.fr */ +/* Updated: 2017/03/08 12:56:35 by gwojda ### ########.fr */ /* */ /* ************************************************************************** */