fixed redirection issues

This commit is contained in:
mdev9
2024-03-04 10:22:17 +01:00
parent 44f8024fc0
commit 66297e73a7
3 changed files with 54 additions and 32 deletions

View File

@ -6,7 +6,7 @@
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/07 15:30:37 by tomoron #+# #+# */
/* Updated: 2024/02/14 12:36:02 by tomoron ### ########.fr */
/* Updated: 2024/03/04 10:10:04 by marde-vr ### ########.fr */
/* */
/* ************************************************************************** */
@ -22,11 +22,16 @@ int echo(t_cmd *args)
put_nl = 0;
args = args->next;
}
while (args && args->type == ARG)
while (args && args->type !=PIPE)
{
ft_putstr_fd(args->token, STDOUT_FILENO);
if (args->next)
ft_putchar_fd(' ', STDOUT_FILENO);
if (args->type != ARG)
args = args->next;
else
{
ft_putstr_fd(args->token, STDOUT_FILENO);
if (args->next)
ft_putchar_fd(' ', STDOUT_FILENO);
}
args = args->next;
}
if (put_nl)