diff --git a/42sh/src/glob/glob.c b/42sh/src/glob/glob.c index 6aa8b783..320b15eb 100644 --- a/42sh/src/glob/glob.c +++ b/42sh/src/glob/glob.c @@ -6,7 +6,7 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/01/04 16:29:54 by wescande #+# #+# */ -/* Updated: 2017/01/26 16:04:09 by wescande ### ########.fr */ +/* Updated: 2017/01/26 17:18:20 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ @@ -52,7 +52,10 @@ char **glob(const char *pat, char **env) mul_pat = expand_brace(pat); while (mul_pat->next) { - if (env && (path = ft_strsplit(ft_getenv(env, "PATH"), ':'))) + if (!(((char *)mul_pat->content)[0] == '/' + || (((char *)mul_pat->content)[0] == '.' + && ((char *)mul_pat->content)[1] == '/')) + && env && (path = ft_strsplit(ft_getenv(env, "PATH"), ':'))) { path_research(mul_pat->content, path, &match); ft_tabdel(&path); diff --git a/42sh/src/glob/glob_print.c b/42sh/src/glob/glob_print.c index 828089a5..38a8bdc0 100644 --- a/42sh/src/glob/glob_print.c +++ b/42sh/src/glob/glob_print.c @@ -6,7 +6,7 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/01/05 16:09:40 by wescande #+# #+# */ -/* Updated: 2017/01/12 15:48:03 by wescande ### ########.fr */ +/* Updated: 2017/01/26 17:14:32 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ @@ -42,7 +42,7 @@ void glob_print(t_list *lst, t_data *data) ; glob_ret = glob(token->data, data->env); DG("%02i '%s'", i, token->data); - ft_tabprint_fd(glob_ret, 2); + ft_tabprint_fd(glob_ret, 3); lst = lst->next; } }