🔨」 fix: fixed single cmd when only heredoc

This commit is contained in:
2024-08-13 19:16:45 +02:00
parent fc7d81fe31
commit 9952ef41ac
2 changed files with 4 additions and 4 deletions

View File

@ -6,7 +6,7 @@
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/06/01 14:55:06 by mmoussou #+# #+# */
/* Updated: 2024/08/13 18:38:18 by mmoussou ### ########.fr */
/* Updated: 2024/08/13 19:16:03 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
@ -54,7 +54,6 @@ int exec_single_cmd(t_cmd *cmd, char **env, t_env *env_t, int pipe_fd[2])
if (!cmd->cmd)
{
free_cmd(cmd);
rl_clear_history();
get_exit_code(0);
return (0);

View File

@ -6,7 +6,7 @@
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/24 11:18:04 by adjoly #+# #+# */
/* Updated: 2024/08/13 16:48:59 by mmoussou ### ########.fr */
/* Updated: 2024/08/13 19:04:41 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
@ -32,7 +32,8 @@ void __parse(char *rl, t_env *env_l)
return ;
get_list(&token);
exec_split_cmd(token, env_l);
ft_lstclear(&token, free_cmd);
if (token)
ft_lstclear(&token, free_cmd);
return ;
}