This commit is contained in:
2024-04-13 12:42:16 +02:00
parent 3a7bbac5cb
commit 51fff7aefd
3 changed files with 13 additions and 4 deletions

View 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/06 12:18:31 by tomoron ### ########.fr */
/* Updated: 2024/04/07 18:40:53 by tomoron ### ########.fr */
/* */
/* ************************************************************************** */
@ -61,7 +61,12 @@ char **get_cmd_args(t_msh *msh)
void remove_command_from_msh(t_msh *msh)
{
free_token(msh->tokens);
while(msh->cmds && is_cmd_type(msh->cmds))
msh->cmds = msh->cmds->next;
while(msh->cmds && !is_cmd_type(msh->cmds))
msh->cmds = msh->cmds->next;
msh->tokens = parse_command(msh->cmds->value, msh->env);
if(msh->cmds)
msh->tokens = parse_command(msh->cmds->value, msh->env);
else
msh->tokens = 0;
}