mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-06 07:28:09 +01:00
fix: make it compile
This commit is contained in:
parent
4baad88a44
commit
1866da6ea6
4 changed files with 15 additions and 22 deletions
|
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* cmd_parsing.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: jguelen <jguelen@student.42.fr> +#+ +:+ +#+ */
|
||||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/03/31 10:28:28 by jguelen #+# #+# */
|
||||
/* Updated: 2025/04/10 18:56:45 by jguelen ### ########.fr */
|
||||
/* Updated: 2025/04/11 16:56:59 by khais ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -62,7 +62,7 @@ t_redirect *minishell_redir_parse(t_minishell *app, t_cmd_builder *builder)
|
|||
t_redirect *redir;
|
||||
|
||||
redir = NULL;
|
||||
while (is_redir(builder->tokens->word->token_type))
|
||||
while (is_redir(builder->tokens->word))
|
||||
{
|
||||
}
|
||||
return (redir);
|
||||
|
|
@ -94,13 +94,13 @@ t_cmd *minishell_simple_parse(t_minishell *app, t_cmd_builder *builder)
|
|||
redir = minishell_redir_parse(app, builder);
|
||||
t_redirect_add_back(&simple->value.simple->redirections, redir);
|
||||
if (ft_errno_get() != FT_ESUCCESS)
|
||||
return (simple_cmd_destroy(simple), NULL);
|
||||
return (t_cmd_destroy(simple), NULL);
|
||||
while (builder->tokens && builder->tokens->word->token_type == WORD_TOKEN)
|
||||
{
|
||||
simple->value.simple->words = wordlist_push(simple->value.simple->words,
|
||||
wordlist_pop(&builder->tokens));
|
||||
if (!simple->value.simple->words)
|
||||
return (ft_errno(FT_EERRNO), simple_cmd_destroy(simple), NULL);
|
||||
return (ft_errno(FT_EERRNO), t_cmd_destroy(simple), NULL);
|
||||
redir = minishell_redir_parse(app, builder);
|
||||
t_redirect_add_back(&simple->value.simple->redirections, redir);
|
||||
}
|
||||
|
|
@ -117,7 +117,7 @@ t_cmd *minishell_opt_pipeline_parse(t_minishell *app, t_cmd_builder *builder)
|
|||
token = builder->tokens->word;
|
||||
if (token->token_type == PIPE_TOKEN)
|
||||
{
|
||||
token = wordlist_pop(builder->tokens);
|
||||
token = wordlist_pop(&builder->tokens);
|
||||
worddesc_destroy(token);
|
||||
opt = minishell_group_or_smp_parse(app, builder);
|
||||
if (!opt)
|
||||
|
|
@ -138,7 +138,7 @@ ft_printf("%s() %s\n", __FUNCTION__, builder->tokens->word->word);
|
|||
|
||||
if (builder->tokens->word->token_type == OPEN_PARENTH_TOKEN)
|
||||
{
|
||||
worddesc_destroy(wordlist_pop(builder->tokens));
|
||||
worddesc_destroy(wordlist_pop(&builder->tokens));
|
||||
subtree = minishell_cmds_parse(app, builder);
|
||||
if (!subtree
|
||||
|| builder->tokens->word->token_type != CLOSE_PARENTH_TOKEN)
|
||||
|
|
@ -148,7 +148,7 @@ ft_printf("%s() %s\n", __FUNCTION__, builder->tokens->word->word);
|
|||
parse_error(app, builder->tokens->word);
|
||||
return (t_cmd_destroy(subtree), NULL);
|
||||
}
|
||||
worddesc_destroy(wordlist_pop(builder->tokens));
|
||||
worddesc_destroy(wordlist_pop(&builder->tokens));
|
||||
group = ft_calloc(1, sizeof(t_cmd));
|
||||
if (!group)
|
||||
return (ft_errno(FT_ENOMEM), t_cmd_destroy(subtree), NULL);
|
||||
|
|
@ -179,7 +179,7 @@ ft_printf("%s() %s\n", __FUNCTION__, builder->tokens->word->word);
|
|||
*connec = FT_OR;
|
||||
else
|
||||
*connec = FT_AND;
|
||||
token = wordlist_pop(builder->tokens);
|
||||
token = wordlist_pop(&builder->tokens);
|
||||
worddesc_destroy(token);
|
||||
opt = minishell_pipeline_parse(app, builder);
|
||||
if (!opt)
|
||||
|
|
@ -276,7 +276,7 @@ ft_printf("%s() %s\n", __FUNCTION__, builder->tokens->word->word);
|
|||
opt = minishell_opt_cmds_parse(app, builder, &connec);
|
||||
}
|
||||
if (ft_errno_get() != FT_ESUCCESS)
|
||||
return (destroy(subtree), NULL);
|
||||
return (t_cmd_destroy(subtree), NULL);
|
||||
return (list);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue