From 705a49b6db6fae4d1e3bf4dc50c3b616a054474a Mon Sep 17 00:00:00 2001 From: Adam Joly Date: Thu, 18 Jul 2024 14:29:17 +0200 Subject: [PATCH] =?UTF-8?q?=E3=80=8C=F0=9F=94=A8=E3=80=8D=20fix:=20fixed?= =?UTF-8?q?=20redir=20in=20echo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/builtins/ft_echo.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/builtins/ft_echo.c b/src/builtins/ft_echo.c index e087a2e..c58acc0 100644 --- a/src/builtins/ft_echo.c +++ b/src/builtins/ft_echo.c @@ -6,7 +6,7 @@ /* By: adjoly +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/06/29 19:19:57 by adjoly #+# #+# */ -/* Updated: 2024/06/29 20:10:14 by adjoly ### ########.fr */ +/* Updated: 2024/07/18 14:28:05 by adjoly ### ########.fr */ /* */ /* ************************************************************************** */ @@ -37,7 +37,7 @@ size_t __nl_option(char **args) return (i); } -void ft_echo(char **args) +void ft_echo(char **args, int fd) { char **tmp; bool new_line; @@ -50,11 +50,11 @@ void ft_echo(char **args) tmp += __nl_option(args); while (*tmp && tmp) { - ft_putstr_fd(*tmp, STDOUT_FILENO); + ft_putstr_fd(*tmp, fd); tmp++; if (*tmp != NULL) - ft_putchar_fd(' ', STDOUT_FILENO); + ft_putchar_fd(' ', fd); } if (new_line == true) - ft_putchar_fd('\n', STDOUT_FILENO); + ft_putchar_fd('\n', fd); }