fix: leak with > but no file
This commit is contained in:
parent
38e1b9834f
commit
642af26133
BIN
.cmds.c.swp
BIN
.cmds.c.swp
Binary file not shown.
6
cmds.c
6
cmds.c
@ -6,7 +6,7 @@
|
|||||||
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2023/02/15 14:17:26 by cchauvet #+# #+# */
|
/* Created: 2023/02/15 14:17:26 by cchauvet #+# #+# */
|
||||||
/* Updated: 2023/02/17 13:06:35 by cchauvet ### ########.fr */
|
/* Updated: 2023/02/17 13:09:13 by cchauvet ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -101,10 +101,8 @@ static int ft_cmds_fill(t_list **cmds, t_list **env, const char *line)
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
t_list **ft_parse_cmds(char *line, t_list **env)
|
t_list **ft_parse_cmds(char *line, t_list **env, int infile, int outfile)
|
||||||
{
|
{
|
||||||
int infile;
|
|
||||||
int outfile;
|
|
||||||
t_list **cmds;
|
t_list **cmds;
|
||||||
|
|
||||||
cmds = malloc(sizeof(t_list *));
|
cmds = malloc(sizeof(t_list *));
|
||||||
|
BIN
env_fill.o
BIN
env_fill.o
Binary file not shown.
BIN
execution.o
BIN
execution.o
Binary file not shown.
3
infile.c
3
infile.c
@ -6,7 +6,7 @@
|
|||||||
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2023/02/15 17:52:10 by cchauvet #+# #+# */
|
/* Created: 2023/02/15 17:52:10 by cchauvet #+# #+# */
|
||||||
/* Updated: 2023/02/16 17:52:29 by cchauvet ### ########.fr */
|
/* Updated: 2023/02/17 13:19:09 by cchauvet ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -33,6 +33,7 @@ static int ft_infile_is_valid(const char *line)
|
|||||||
if (tab[i][0] == '<')
|
if (tab[i][0] == '<')
|
||||||
{
|
{
|
||||||
ft_eprintf("minishell: %s: must be followed by an infile\n", tab[i]);
|
ft_eprintf("minishell: %s: must be followed by an infile\n", tab[i]);
|
||||||
|
ft_freer_tab_ultimate(1, tab);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
ft_freer_tab_ultimate(1, tab);
|
ft_freer_tab_ultimate(1, tab);
|
||||||
|
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.
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.
4
main.c
4
main.c
@ -6,7 +6,7 @@
|
|||||||
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2023/02/16 15:16:14 by cchauvet #+# #+# */
|
/* Created: 2023/02/16 15:16:14 by cchauvet #+# #+# */
|
||||||
/* Updated: 2023/02/17 13:05:54 by cchauvet ### ########.fr */
|
/* Updated: 2023/02/17 13:13:19 by cchauvet ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -45,6 +45,7 @@ int main(int ac, char **av, char **env)
|
|||||||
ft_lstclear(data.env, env_del);
|
ft_lstclear(data.env, env_del);
|
||||||
free(data.env);
|
free(data.env);
|
||||||
free(line);
|
free(line);
|
||||||
|
return (1);
|
||||||
}
|
}
|
||||||
infile = ft_infile(line);
|
infile = ft_infile(line);
|
||||||
if (infile == -2)
|
if (infile == -2)
|
||||||
@ -53,6 +54,7 @@ int main(int ac, char **av, char **env)
|
|||||||
ft_lstclear(data.env, env_del);
|
ft_lstclear(data.env, env_del);
|
||||||
free(data.env);
|
free(data.env);
|
||||||
free(line);
|
free(line);
|
||||||
|
return (1);
|
||||||
}
|
}
|
||||||
cmds = ft_parse_cmds(line, data.env, infile, outfile);
|
cmds = ft_parse_cmds(line, data.env, infile, outfile);
|
||||||
if (cmds == NULL)
|
if (cmds == NULL)
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2023/02/15 18:01:07 by cchauvet #+# #+# */
|
/* Created: 2023/02/15 18:01:07 by cchauvet #+# #+# */
|
||||||
/* Updated: 2023/02/16 17:53:28 by cchauvet ### ########.fr */
|
/* Updated: 2023/02/17 13:19:46 by cchauvet ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -32,6 +32,7 @@ static int ft_outfile_is_valid(const char *line)
|
|||||||
if (tab[i][0] == '>')
|
if (tab[i][0] == '>')
|
||||||
{
|
{
|
||||||
ft_eprintf("minishell: %s: must be followed by an infile\n", tab[i]);
|
ft_eprintf("minishell: %s: must be followed by an infile\n", tab[i]);
|
||||||
|
ft_freer_tab_ultimate(1, tab);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
ft_freer_tab_ultimate(1, tab);
|
ft_freer_tab_ultimate(1, tab);
|
||||||
|
@ -71,6 +71,7 @@ static int ft_special_char_dub(const char *str)
|
|||||||
}
|
}
|
||||||
i = i + y;
|
i = i + y;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
return (0);
|
return (0);
|
||||||
|
BIN
syntatics.o
BIN
syntatics.o
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user