fix: outfile is now perfectly removed
This commit is contained in:
parent
922db1e08f
commit
4b5a50d7fe
BIN
.outfile.c.swp
Normal file
BIN
.outfile.c.swp
Normal file
Binary file not shown.
4
infile.c
4
infile.c
@ -6,7 +6,7 @@
|
||||
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/02/15 17:52:10 by cchauvet #+# #+# */
|
||||
/* Updated: 2023/02/17 13:19:09 by cchauvet ### ########.fr */
|
||||
/* Updated: 2023/02/17 18:30:30 by cchauvet ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -92,7 +92,7 @@ static int ft_remove_infile(char *line)
|
||||
ft_strshift(line + y, -1 * (ft_strlen(tab[i]) + 1));
|
||||
}
|
||||
else
|
||||
y = y + ft_strlen(tab[i]);
|
||||
y = y + ft_strlen(tab[i]) + 1;
|
||||
i++;
|
||||
}
|
||||
ft_freer_tab_ultimate(1, tab);
|
||||
|
10
outfile.c
10
outfile.c
@ -6,7 +6,7 @@
|
||||
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/02/15 18:01:07 by cchauvet #+# #+# */
|
||||
/* Updated: 2023/02/17 13:19:46 by cchauvet ### ########.fr */
|
||||
/* Updated: 2023/02/17 18:50:02 by cchauvet ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -86,12 +86,14 @@ static int ft_remove_outfile(char *line)
|
||||
{
|
||||
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
|
||||
{
|
||||
if (y != 0)
|
||||
y++;
|
||||
y = y + ft_strlen(tab[i]);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
ft_freer_tab_ultimate(1, tab);
|
||||
|
Loading…
Reference in New Issue
Block a user