Merge into master my changes (#3)
* WIP * Compiling! * moved some more headers * removed src/point.h * Update * fixed some stuff
This commit is contained in:
parent
24d122dc54
commit
f51a071d03
33 changed files with 805 additions and 339 deletions
|
|
@ -6,22 +6,22 @@
|
|||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/03/29 11:35:51 by rparodi #+# #+# */
|
||||
/* Updated: 2024/04/13 20:15:37 by rparodi ### ########.fr */
|
||||
/* Updated: 2024/04/30 16:16:55 by maiboyer ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "../includes/minishell.h"
|
||||
|
||||
void ft_free(void *ptr)
|
||||
void ft_free(void *ptr)
|
||||
{
|
||||
if (!ptr)
|
||||
free(ptr);
|
||||
ptr = NULL;
|
||||
}
|
||||
|
||||
void ft_free_strs(t_str *strs)
|
||||
void ft_free_strs(t_str *strs)
|
||||
{
|
||||
t_usize i;
|
||||
t_usize i;
|
||||
|
||||
i = 0;
|
||||
while (strs[i])
|
||||
|
|
@ -32,20 +32,15 @@ void ft_free_strs(t_str *strs)
|
|||
ft_free(strs);
|
||||
}
|
||||
|
||||
void ft_free_utils(t_utils *s)
|
||||
void ft_free_utils(t_utils *s)
|
||||
{
|
||||
if (s->name_shell)
|
||||
ft_free(s->name_shell);
|
||||
(void)(s);
|
||||
if (s->str_input)
|
||||
ft_free(s->str_input);
|
||||
if (s->strs_input)
|
||||
ft_free_strs(s->strs_input);
|
||||
if (s->path)
|
||||
ft_free_strs(s->path);
|
||||
free(s);
|
||||
free(s->str_input);
|
||||
ts_parser_delete(s->parser.parser);
|
||||
}
|
||||
|
||||
void ft_exit(t_utils *maiboyerlpb, t_u8 exit_status)
|
||||
void ft_exit(t_utils *maiboyerlpb, t_u8 exit_status)
|
||||
{
|
||||
if (maiboyerlpb != NULL)
|
||||
ft_free_utils(maiboyerlpb);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/03/28 14:40:38 by rparodi #+# #+# */
|
||||
/* Updated: 2024/04/30 15:46:55 by rparodi ### ########.fr */
|
||||
/* Updated: 2024/04/30 16:15:53 by maiboyer ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -67,6 +67,7 @@ void ft_check(t_utils *shcat, char **input) {
|
|||
void exec_shcat(t_utils *shcat)
|
||||
{
|
||||
print_node_data(&shcat->current_node, 0);
|
||||
free_node(shcat->current_node);
|
||||
}
|
||||
|
||||
void ft_take_args(t_utils *shcat)
|
||||
|
|
@ -81,7 +82,6 @@ void ft_take_args(t_utils *shcat)
|
|||
shcat->current_node = parse_str(&shcat->parser, shcat->str_input);
|
||||
exec_shcat(shcat);
|
||||
add_history(shcat->str_input);
|
||||
ft_free_strs(shcat->strs_input);
|
||||
free(shcat->str_input);
|
||||
i++;
|
||||
}
|
||||
|
|
@ -138,7 +138,4 @@ t_i32 main(t_i32 argc, t_str argv[], t_str arge[])
|
|||
ft_find_path(arge, &utils);
|
||||
utils.name_shell = "42sh > ";
|
||||
ft_take_args(&utils);
|
||||
// node = parse_string(&parser, "banane \"$VAR\"'truc'");
|
||||
// print_node_data(&node, 0);
|
||||
// free_node(node);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue