fix: quote verif is better

This commit is contained in:
Camille Chauvet
2023-03-13 19:28:46 +01:00
parent 08261b1921
commit ee3d535393
3 changed files with 26 additions and 14 deletions

View File

@ -24,8 +24,10 @@ static char *ft_spacer_after(const char *str)
i = 1;
while (out[i] != '\0')
{
while (ft_is_in_quote(out, i))
while (ft_is_in_quote(out, i - 1))
i++;
if (out[i] == '\0')
break ;
if (ft_is_in("><|", out[i - 1]))
{
while (out[i] == out[i - 1])
@ -56,6 +58,8 @@ static char *ft_spacer_before(const char *str)
{
while (ft_is_in_quote(out, i))
i++;
if (out[i] == '\0')
break ;
if (ft_is_in("><|", out[i + 1]))
{
while (out[i] == ' ')
@ -83,6 +87,8 @@ static void ft_space_simplifier(char *str)
{
if (ft_is_in_quote(str, i))
i++;
if (str[i] != '\0')
break ;
y = 0;
while (str[y + i] == ' ')
y++;