From dce9df5008557a15b06fdabd6a10ce0446850fb2 Mon Sep 17 00:00:00 2001 From: gwojda Date: Tue, 14 Mar 2017 17:21:56 +0100 Subject: [PATCH] correction rematch env --- 42sh/src/completion/c_seek_env.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/42sh/src/completion/c_seek_env.c b/42sh/src/completion/c_seek_env.c index 9fa8d0ea..dfc8198c 100644 --- a/42sh/src/completion/c_seek_env.c +++ b/42sh/src/completion/c_seek_env.c @@ -6,7 +6,7 @@ /* By: gwojda +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/09 15:50:24 by gwojda #+# #+# */ -/* Updated: 2017/03/14 10:10:19 by gwojda ### ########.fr */ +/* Updated: 2017/03/14 17:21:37 by gwojda ### ########.fr */ /* */ /* ************************************************************************** */ @@ -37,7 +37,8 @@ int c_seek_env(t_comp *c, char *current_word) match = ft_strdupi_w(current_word + 1); while (env[i]) { - if (!ft_strncmp(match, env[i], ft_strlen(match))) + if (!ft_strncmp(match, env[i], ft_strlen(match)) && + env[i][ft_strlen(match)] != '=') c_storing(c, ft_strndup(env[i], ft_strchr(env[i], '=') - env[i])); ++i; }