fix and free
This commit is contained in:
parent
1a04f73b49
commit
6ab114eeeb
Binary file not shown.
@ -1,7 +1,7 @@
|
|||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
/* */
|
/* */
|
||||||
/* ::: :::::::: */
|
/* ::: :::::::: */
|
||||||
/* ft_split.c :+: :+: :+: */
|
/* ft_split_quoted.c :+: :+: :+: */
|
||||||
/* +:+ +:+ +:+ */
|
/* +:+ +:+ +:+ */
|
||||||
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,4 +1,4 @@
|
|||||||
#include "utils.h"
|
#include "extra.h"
|
||||||
|
|
||||||
void ft_swap(void *a, void *b)
|
void ft_swap(void *a, void *b)
|
||||||
{
|
{
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
libftx/libftx.a
BIN
libftx/libftx.a
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
17
main.c
17
main.c
@ -3,17 +3,14 @@
|
|||||||
|
|
||||||
void ft_lstdel(void *ptr)
|
void ft_lstdel(void *ptr)
|
||||||
{
|
{
|
||||||
t_list *element;
|
|
||||||
t_cmd *content;
|
t_cmd *content;
|
||||||
|
|
||||||
element = (t_list *) ptr;
|
content = (t_cmd *) ptr;
|
||||||
content = (t_cmd *) element->content;
|
|
||||||
if (content->executable != NULL)
|
if (content->executable != NULL)
|
||||||
free(content->executable);
|
free(content->executable);
|
||||||
if (content->args != NULL)
|
if (content->args != NULL)
|
||||||
ft_freer_tab_ultimate(1, content->args);
|
ft_freer_tab_ultimate(1, content->args);
|
||||||
free(content);
|
free(content);
|
||||||
free(element);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int ft_cmds_init(t_list **cmds, size_t len)
|
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;
|
t_list *current;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
(void) cmds;
|
|
||||||
tab = ft_split_quoted(line, '|');
|
tab = ft_split_quoted(line, '|');
|
||||||
if (tab == NULL)
|
if (tab == NULL)
|
||||||
return (1);
|
return (1);
|
||||||
@ -163,12 +159,13 @@ int ft_cmds_fill(t_list **cmds, const char *line)
|
|||||||
if (ft_cmd_filler(current, args) == 1)
|
if (ft_cmd_filler(current, args) == 1)
|
||||||
{
|
{
|
||||||
ft_lstclear(cmds, ft_lstdel);
|
ft_lstclear(cmds, ft_lstdel);
|
||||||
ft_freer_tab_ultimate(1, args);
|
ft_freer_tab_ultimate(2, args, tab);
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
current = current->next;
|
current = current->next;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
ft_freer_tab_ultimate(1, tab);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -221,7 +218,11 @@ int main(int ac, char **av)
|
|||||||
if (cmds == NULL)
|
if (cmds == NULL)
|
||||||
return (1);
|
return (1);
|
||||||
if (ft_cmds_excutor(cmds) == 1)
|
if (ft_cmds_excutor(cmds) == 1)
|
||||||
return (1);
|
{
|
||||||
ft_lstclear(cmds);
|
ft_lstclear(cmds, ft_lstdel);
|
||||||
|
return (1);
|
||||||
|
}
|
||||||
|
ft_lstclear(cmds, ft_lstdel);
|
||||||
|
free(cmds);
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
BIN
syntatics.o
BIN
syntatics.o
Binary file not shown.
24
t
24
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
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user