diff --git a/.file.c.swp b/.main.c.swp similarity index 50% rename from .file.c.swp rename to .main.c.swp index 8d73039..5a8e79e 100644 Binary files a/.file.c.swp and b/.main.c.swp differ diff --git a/file.o b/file.o index f7d44cf..301b027 100644 Binary files a/file.o and b/file.o differ diff --git a/ft_split_quoted.c b/ft_split_quoted.c index a9335fb..03b1fb2 100644 --- a/ft_split_quoted.c +++ b/ft_split_quoted.c @@ -1,7 +1,7 @@ /* ************************************************************************** */ /* */ /* ::: :::::::: */ -/* ft_split.c :+: :+: :+: */ +/* ft_split_quoted.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: cchauvet content; + content = (t_cmd *) ptr; if (content->executable != NULL) free(content->executable); if (content->args != NULL) ft_freer_tab_ultimate(1, content->args); free(content); - free(element); } int ft_cmds_init(t_list **cmds, size_t len) @@ -151,7 +148,6 @@ int ft_cmds_fill(t_list **cmds, const char *line) t_list *current; size_t i; - (void) cmds; tab = ft_split_quoted(line, '|'); if (tab == NULL) return (1); @@ -163,12 +159,13 @@ int ft_cmds_fill(t_list **cmds, const char *line) if (ft_cmd_filler(current, args) == 1) { ft_lstclear(cmds, ft_lstdel); - ft_freer_tab_ultimate(1, args); + ft_freer_tab_ultimate(2, args, tab); return (1); } current = current->next; i++; } + ft_freer_tab_ultimate(1, tab); return (0); } @@ -221,7 +218,11 @@ int main(int ac, char **av) if (cmds == NULL) return (1); if (ft_cmds_excutor(cmds) == 1) + { + ft_lstclear(cmds, ft_lstdel); return (1); - ft_lstclear(cmds); + } + ft_lstclear(cmds, ft_lstdel); + free(cmds); return (1); } diff --git a/main.o b/main.o index babf8b8..e9ec63f 100644 Binary files a/main.o and b/main.o differ diff --git a/minishell b/minishell index 4c2107d..a68f917 100755 Binary files a/minishell and b/minishell differ diff --git a/outfile.o b/outfile.o index 0f40334..cdcda83 100644 Binary files a/outfile.o and b/outfile.o differ diff --git a/syntatics.o b/syntatics.o index cf454fd..94919ef 100644 Binary files a/syntatics.o and b/syntatics.o differ diff --git a/t b/t index d0b1d06..e69de29 100644 --- a/t +++ b/t @@ -1,24 +0,0 @@ -a.out -argprinter -d -execution.c -file.c -file.o -ft_split_quoted.c -ft_split_quoted.o -heredoc.c -heredoc.o -infile.c -infile.o -libftx -main.c -main.o -Makefile -minishell -minishell.h -outfile.c -outfile.o -syntatics.c -syntatics.o -t -utils diff --git a/utils/ft_getstr.o b/utils/ft_getstr.o index abfa88a..b76c43a 100644 Binary files a/utils/ft_getstr.o and b/utils/ft_getstr.o differ diff --git a/utils/ft_is_in_quote.o b/utils/ft_is_in_quote.o index 4552d07..74e6223 100644 Binary files a/utils/ft_is_in_quote.o and b/utils/ft_is_in_quote.o differ diff --git a/utils/ft_strnchr.o b/utils/ft_strnchr.o index 2069436..0636ff4 100644 Binary files a/utils/ft_strnchr.o and b/utils/ft_strnchr.o differ diff --git a/utils/ft_strncpy.o b/utils/ft_strncpy.o index 07b66cd..ef6d219 100644 Binary files a/utils/ft_strncpy.o and b/utils/ft_strncpy.o differ diff --git a/utils/ft_strreplace.o b/utils/ft_strreplace.o index ea3e08c..da954a8 100644 Binary files a/utils/ft_strreplace.o and b/utils/ft_strreplace.o differ