From 4084439f7d3583b4240cf8670fc7e23445ece00c Mon Sep 17 00:00:00 2001 From: gwojda Date: Tue, 14 Mar 2017 17:07:59 +0100 Subject: [PATCH 1/2] rip leaks --- 42sh/libft | 2 +- 42sh/src/main/main.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/42sh/libft b/42sh/libft index 9382dc10..fb9b737b 160000 --- a/42sh/libft +++ b/42sh/libft @@ -1 +1 @@ -Subproject commit 9382dc10fdb91892ab26604a5776e5301ab88b71 +Subproject commit fb9b737be2598ec204afb974ec02f7bce5261b6b diff --git a/42sh/src/main/main.c b/42sh/src/main/main.c index 4da9ed74..52e16739 100644 --- a/42sh/src/main/main.c +++ b/42sh/src/main/main.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* 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); } From dce9df5008557a15b06fdabd6a10ce0446850fb2 Mon Sep 17 00:00:00 2001 From: gwojda Date: Tue, 14 Mar 2017 17:21:56 +0100 Subject: [PATCH 2/2] 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; }