CORINNE J'AI CHAUD, VIENS 42

This commit is contained in:
Etienne Rey-bethbeder 2023-03-13 16:30:45 +01:00
parent 1b17df6170
commit 7ffe556cd4

View File

@ -6,7 +6,7 @@
/* By: erey-bet <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/02/17 13:09:08 by erey-bet #+# #+# */
/* Updated: 2023/02/22 13:23:16 by erey-bet ### ########.fr */
/* Updated: 2023/03/13 16:29:47 by erey-bet ### ########.fr */
/* */
/* ************************************************************************** */
@ -28,6 +28,8 @@ int check_argument(char *str, int *check)
return (1);
if (ft_strnstr(str, "n", ft_strlen(str)))
*check = 1;
else
return (1);
return (0);
}
@ -42,8 +44,9 @@ int echo(int fd, char **strs)
{
while (is_space(*strs[i]))
strs[i]++;
if (check == 1 || check_argument(strs[i], &check))
if (check == 2 || check_argument(strs[i], &check))
{
check = 2;
ft_putstr_fd(strs[i], fd);
if (strs[i + 1] != NULL)
write(fd, " ", 1);