renamed functions to improve readability and removed useless test files

This commit is contained in:
mdev9
2024-02-13 16:29:25 +01:00
parent 99e229192d
commit 6ee8507cae
15 changed files with 97 additions and 33097 deletions

35
echo.c Executable file
View File

@ -0,0 +1,35 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* echo.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/07 15:30:37 by tomoron #+# #+# */
/* Updated: 2024/02/13 16:11:20 by marde-vr ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
int echo(t_cmd *args)
{
int put_nl;
put_nl = 1;
while (args && !strcmp(args->token, "-n"))
{
put_nl = 0;
args = args->next;
}
while (args)
{
ft_putstr_fd(args->token, STDOUT_FILENO);
if (args->next)
ft_putchar_fd(' ', STDOUT_FILENO);
args = args->next;
}
if (put_nl)
ft_putchar_fd('\n', STDOUT_FILENO);
return (0);
}