l'execution marche (un petit peu) ( je crois)
This commit is contained in:
14
srcs/commands.c
Normal file → Executable file
14
srcs/commands.c
Normal file → Executable file
@ -6,7 +6,7 @@
|
||||
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/03/05 18:22:15 by marde-vr #+# #+# */
|
||||
/* Updated: 2024/04/02 13:48:48 by tomoron ### ########.fr */
|
||||
/* Updated: 2024/04/03 15:45:49 by tomoron ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -36,11 +36,11 @@ char **get_cmd_args(t_msh *msh)
|
||||
int args_count;
|
||||
int i;
|
||||
|
||||
args_count = get_args_count(msh->cmds);
|
||||
args_count = get_args_count(msh->tokens);
|
||||
cmd_args = ft_calloc(args_count + 1, sizeof(char *));
|
||||
if (!cmd_args)
|
||||
ft_exit(msh, 1);
|
||||
cur_cmd = msh->cmds;
|
||||
cur_cmd = msh->tokens;
|
||||
i = 0;
|
||||
while (i < args_count)
|
||||
{
|
||||
@ -63,7 +63,7 @@ void remove_command_from_msh(t_msh *msh)
|
||||
t_token *cur_cmd;
|
||||
t_token *cmd_tmp;
|
||||
|
||||
cur_cmd = msh->cmds;
|
||||
cur_cmd = msh->tokens;
|
||||
while (cur_cmd && cur_cmd->next)
|
||||
{
|
||||
if (/*cur_cmd->type == PIPE*/ 0)
|
||||
@ -73,7 +73,7 @@ void remove_command_from_msh(t_msh *msh)
|
||||
//msh->in_type = cmd_tmp->type;
|
||||
free(cmd_tmp->value);
|
||||
free(cmd_tmp);
|
||||
msh->cmds = cur_cmd;
|
||||
msh->tokens = cur_cmd;
|
||||
return ;
|
||||
}
|
||||
cmd_tmp = cur_cmd;
|
||||
@ -81,7 +81,7 @@ void remove_command_from_msh(t_msh *msh)
|
||||
//msh->in_type = cur_cmd->type;
|
||||
free(cmd_tmp->value);
|
||||
free(cmd_tmp);
|
||||
msh->cmds = cur_cmd;
|
||||
msh->tokens = cur_cmd;
|
||||
}
|
||||
//msh->in_type = msh->cmds->type;
|
||||
//msh->in_type = msh->tokens->type;
|
||||
}
|
||||
|
Reference in New Issue
Block a user