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 +#+ +:+ +#+ */ /* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2023/02/15 17:52:10 by cchauvet #+# #+# */ /* 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) while (tab[i] != NULL)
{ {
if (tab[i][0] == '<') if (tab[i][0] == '<')
{ ft_strshift(line + y,
ft_strshift(line + y, -1 * (ft_strlen(tab[i]) + 1)); -1 * (ft_strlen(tab[i]) + ft_strlen(tab[i + 1]) + 2));
i++;
ft_strshift(line + y, -1 * (ft_strlen(tab[i]) + 1));
}
else else
y = y + ft_strlen(tab[i]) + 1; y = y + ft_strlen(tab[i]) + (y != 0);
i++; i++;
} }
ft_freer_tab_ultimate(1, tab); ft_freer_tab_ultimate(1, tab);