From e48ee8b6930b97913e47d2b2b51c08065de48214 Mon Sep 17 00:00:00 2001 From: Camille Chauvet Date: Thu, 16 Feb 2023 16:29:46 +0100 Subject: [PATCH] fix: empty line, leaks, pipe --- .fill_env.c.swp | Bin 0 -> 12288 bytes Makefile | 2 +- env.c | 3 ++- minishell.h | 2 +- spacer.c | 7 +++++-- syntatics.c | 6 ++++-- utils/ft_str_is_empty.c | 23 +++++++++++++++++++++++ utils/utils.h | 4 ++-- 8 files changed, 38 insertions(+), 9 deletions(-) create mode 100644 .fill_env.c.swp create mode 100644 utils/ft_str_is_empty.c diff --git a/.fill_env.c.swp b/.fill_env.c.swp new file mode 100644 index 0000000000000000000000000000000000000000..164f87ed8368dd090827827fcd1c796dcb97e8ac GIT binary patch literal 12288 zcmeI2K}y3w6o#j+t%~kkjRq7N$Ruegb#Nhy3l}cyQc0VsEvB`!X|Wq!sORwlUcd`@ z7MH#>nI=euszE6H6JFj+GV^8TgDgs?VPBk`^P1%_Y8%lhZt7!?HJfd3G*+R$_g!{Q zU8~}Hz3baipt{Ox4d(Z}*FaHmMYq%I4BILQM5_}7SE@I*n)8R@E)2jxE(VJAvg_Cp z%GllETbuPD+HP6c zu5hZ{sY>@i+BM#oaJ{{G_G-g0sHXF@(Z1;9i3Xkw)X#w2Fe9Q)36B46$tJ;)gFsZx za4GP3BGY9Z>IEJR!;!CgVP@BNJa!5(r6y&VddZo0ELKLelt}YT=o*;r9$$<{y`(AQ izDW@$4O|$L?I@*2QWZ6N_$Oc%uIm_>+lN9QonW8PH@O1< literal 0 HcmV?d00001 diff --git a/Makefile b/Makefile index 1142f9a..8d576dc 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -UTILS_SRC = utils/ft_is_in_quote.c utils/ft_strncpy.c utils/ft_strreplace.c utils/ft_strnchr.c utils/ft_split_quoted.c utils/ft_strshift.c utils/ft_quote_remover.c +UTILS_SRC = utils/ft_is_in_quote.c utils/ft_strncpy.c utils/ft_strreplace.c utils/ft_strnchr.c utils/ft_split_quoted.c utils/ft_strshift.c utils/ft_quote_remover.c utils/ft_str_is_empty.c SRCS = ${UTILS_SRC} main.c file.c infile.c outfile.c heredoc.c syntatics.c cmd.c cmds.c env.c execution.c spacer.c OBJS = ${SRCS:.c=.o} diff --git a/env.c b/env.c index cab6ec4..bb3d3f8 100644 --- a/env.c +++ b/env.c @@ -6,7 +6,7 @@ /* By: erey-bet +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/02/02 14:39:56 by erey-bet #+# #+# */ -/* Updated: 2023/02/16 15:18:48 by cchauvet ### ########.fr */ +/* Updated: 2023/02/16 16:24:21 by cchauvet ### ########.fr */ /* */ /* ************************************************************************** */ @@ -113,6 +113,7 @@ void env_del(void *ptr) content = ptr; free(content->key); free(content->value); + free(content); } char *get_key(char *str) diff --git a/minishell.h b/minishell.h index 966233f..c3d4f4d 100644 --- a/minishell.h +++ b/minishell.h @@ -6,7 +6,7 @@ /* By: cchauvet