fixed redirection issues
This commit is contained in:
15
srcs/echo.c
15
srcs/echo.c
@ -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)
|
||||
|
Reference in New Issue
Block a user