From 72b4180d55a2584a42681c2ca461019790e6da5c Mon Sep 17 00:00:00 2001 From: y-syo Date: Thu, 18 Jul 2024 14:45:15 +0200 Subject: [PATCH] =?UTF-8?q?=E3=80=8C=F0=9F=97=91=EF=B8=8F=E3=80=8D=20clean?= =?UTF-8?q?(builtins/echo):=20cleaned=20garbage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/builtins.h | 4 ++-- src/builtins/ft_echo.c | 11 +++++------ src/exec/exec_cmd.c | 4 ++-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/include/builtins.h b/include/builtins.h index ff3b80d..27b35e7 100644 --- a/include/builtins.h +++ b/include/builtins.h @@ -6,7 +6,7 @@ /* By: mmoussou 0) new_line = false; @@ -51,11 +50,11 @@ void ft_echo(char **args, int fd) tmp += __nl_option(args); while (*tmp && tmp) { - ft_putstr_fd(*tmp, fd); + ft_putstr_fd(*tmp, STDOUT_FILENO); tmp++; if (*tmp != NULL) - ft_putchar_fd(' ', fd); + ft_putchar_fd(' ', STDOUT_FILENO); } if (new_line == true) - ft_putchar_fd('\n', fd); + ft_putchar_fd('\n', STDOUT_FILENO); } diff --git a/src/exec/exec_cmd.c b/src/exec/exec_cmd.c index e5c6cbf..b6f6517 100644 --- a/src/exec/exec_cmd.c +++ b/src/exec/exec_cmd.c @@ -6,7 +6,7 @@ /* By: mmoussou argv + 1, cmd->outfile); + ft_echo(cmd->argv + 1); if (i == 2) ft_cd(env_t, (cmd->argv)[1]); if (i == 6)