This commit is contained in:
Tom Moron
2024-02-09 16:43:35 +01:00
parent 22403b127e
commit ce72dde43e
12 changed files with 242 additions and 244 deletions

View File

@ -6,7 +6,7 @@
/* By: tomoron <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/07 15:30:37 by tomoron #+# #+# */
/* Updated: 2024/02/07 23:15:04 by tomoron ### ########.fr */
/* Updated: 2024/02/09 14:56:57 by tomoron ### ########.fr */
/* */
/* ************************************************************************** */
@ -14,22 +14,22 @@
int ft_echo(t_cmd *args)
{
int put_nl;
int put_nl;
put_nl = 1;
while(args && !strcmp(args->token,"-n"))
while (args && !strcmp(args->token, "-n"))
{
put_nl = 0;
args = args->next;
}
while(args)
while (args)
{
ft_putstr_fd(args->token, STDOUT_FILENO);
if(args->next)
ft_putchar_fd(' ',STDOUT_FILENO);
if (args->next)
ft_putchar_fd(' ', STDOUT_FILENO);
args = args->next;
}
if(put_nl)
ft_putchar_fd('\n',STDOUT_FILENO);
return(0);
if (put_nl)
ft_putchar_fd('\n', STDOUT_FILENO);
return (0);
}