Merge branch 'quinten'
This commit is contained in:
commit
21b3245ebf
@ -59,5 +59,6 @@ typedef struct s_minishell
|
||||
char *line;
|
||||
t_lexer *lexer;
|
||||
t_list *tokens;
|
||||
t_list *commands;
|
||||
} t_minishell;
|
||||
#endif // TYPEDEF_H
|
||||
|
||||
@ -15,7 +15,6 @@
|
||||
int main(int argc, char **argv, char **envp)
|
||||
{
|
||||
t_minishell *minishell;
|
||||
t_list *commands;
|
||||
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
@ -28,11 +27,10 @@ int main(int argc, char **argv, char **envp)
|
||||
minishell->line = ft_prompt(minishell);
|
||||
minishell->lexer = ft_lexer_new(minishell->line);
|
||||
minishell->tokens = ft_parse_input(minishell->lexer);
|
||||
commands = parser_get_commands(minishell->tokens);
|
||||
simple_builtins(minishell);
|
||||
minishell->commands = parser_get_commands(minishell->tokens);
|
||||
//ft_lstiter(minishell->tokens, print_list);
|
||||
free_minishell_line(minishell);
|
||||
ft_lstclear(&commands, free_command_list);
|
||||
ft_lstclear(&minishell->commands, free_command_list);
|
||||
}
|
||||
free_minishell(minishell);
|
||||
return (EXIT_SUCCESS);
|
||||
|
||||
@ -20,4 +20,6 @@ void free_minishell_line(t_minishell *minishell)
|
||||
ft_lexer_free(minishell->lexer);
|
||||
if (minishell->tokens)
|
||||
ft_lstclear(&minishell->tokens, ft_clear_tokenlist);
|
||||
if (minishell->commands)
|
||||
ft_lstclear(&minishell->commands, free_command_list);
|
||||
}
|
||||
|
||||
@ -26,5 +26,6 @@ t_minishell *init_minishell(void)
|
||||
minishell->line = NULL;
|
||||
minishell->lexer = NULL;
|
||||
minishell->tokens = NULL;
|
||||
minishell->commands = NULL;
|
||||
return (minishell);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user