Compare commits

..

No commits in common. "7ea602b12c4680905b0d812c988d743c0aba3ced" and "6ce54ea6fe0eceb1b68a2156acd12d63d6100f01" have entirely different histories.

View File

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