fix echo
This commit is contained in:
13
srcs/echo.c
13
srcs/echo.c
@ -6,7 +6,7 @@
|
|||||||
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
|
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/02/07 15:30:37 by tomoron #+# #+# */
|
/* Created: 2024/02/07 15:30:37 by tomoron #+# #+# */
|
||||||
/* Updated: 2024/03/26 08:43:16 by marde-vr ### ########.fr */
|
/* Updated: 2024/03/26 14:14:29 by tomoron ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -46,17 +46,12 @@ int echo(t_cmd *args)
|
|||||||
i++;
|
i++;
|
||||||
if (!args->token[i])
|
if (!args->token[i])
|
||||||
put_nl = 0;
|
put_nl = 0;
|
||||||
if (put_nl)
|
else
|
||||||
put_args(args);
|
ft_printf("%s ",args->token);
|
||||||
args = args->next;
|
args = args->next;
|
||||||
}
|
}
|
||||||
if (!put_nl)
|
put_args(args);
|
||||||
put_args(args);
|
|
||||||
if (put_nl)
|
if (put_nl)
|
||||||
{
|
|
||||||
if (!(args->token[0] == '-'))
|
|
||||||
put_args(args);
|
|
||||||
ft_putchar_fd('\n', STDOUT_FILENO);
|
ft_putchar_fd('\n', STDOUT_FILENO);
|
||||||
}
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user