infile fix

This commit is contained in:
starnakin 2023-02-20 13:08:01 +01:00
parent c75c6838d6
commit 7eedf74847

View File

@ -6,7 +6,7 @@
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/02/15 17:52:10 by cchauvet #+# #+# */
/* Updated: 2023/02/17 18:30:30 by cchauvet ### ########.fr */
/* Updated: 2023/02/20 13:05:43 by starnakin ### ########.fr */
/* */
/* ************************************************************************** */
@ -86,13 +86,10 @@ static int ft_remove_infile(char *line)
while (tab[i] != NULL)
{
if (tab[i][0] == '<')
{
ft_strshift(line + y, -1 * (ft_strlen(tab[i]) + 1));
i++;
ft_strshift(line + y, -1 * (ft_strlen(tab[i]) + 1));
}
ft_strshift(line + y,
-1 * (ft_strlen(tab[i]) + ft_strlen(tab[i + 1]) + 2));
else
y = y + ft_strlen(tab[i]) + 1;
y = y + ft_strlen(tab[i]) + (y != 0);
i++;
}
ft_freer_tab_ultimate(1, tab);