Merge branch 'master' of github.com:jzck/42sh

This commit is contained in:
wescande 2017-03-14 20:22:16 +01:00
commit 9cb019a4e4
3 changed files with 7 additions and 4 deletions

@ -1 +1 @@
Subproject commit 9382dc10fdb91892ab26604a5776e5301ab88b71
Subproject commit fb9b737be2598ec204afb974ec02f7bce5261b6b

View file

@ -6,7 +6,7 @@
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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;
}

View file

@ -6,7 +6,7 @@
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/06 18:40:58 by jhalford #+# #+# */
/* Updated: 2017/03/13 23:58:56 by jhalford ### ########.fr */
/* Updated: 2017/03/14 17:05:45 by gwojda ### ########.fr */
/* */
/* ************************************************************************** */
@ -79,6 +79,8 @@ int handle_instruction(int fd)
instruction_free(&token, &parser, &ast);
if (SH_IS_INTERACTIVE(data_singleton()->opts) && *lexer.str)
ft_add_str_in_history(lexer.str);
ft_strdel(&lexer.str);
free(parser.new_sym);
return (0);
}