srcs a la norme

This commit is contained in:
Hugo LAMY
2021-12-20 17:02:57 +01:00
parent 8959166804
commit 7de89b43b1
4 changed files with 11 additions and 27 deletions

View File

@@ -6,7 +6,7 @@
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/11/13 07:08:40 by lperrey #+# #+# */
/* Updated: 2021/11/26 21:27:10 by lperrey ### ########.fr */
/* Updated: 2021/12/20 16:45:10 by hulamy ### ########.fr */
/* */
/* ************************************************************************** */
@@ -148,7 +148,7 @@ static void fill_arr(char const *s, char c, char **str_arr)
if (s[i] && (s[i] != c || quote_state))
str_arr[arr_i][char_i++] = s[i++];
}
str_arr[arr_i][char_i] = '\0'; //superflu si ft_calloc
str_arr[arr_i][char_i] = '\0';
arr_i++;
}
}
@@ -159,7 +159,7 @@ static int quote_state_change(int *quote_state, const char *s)
{
if (*quote_state == IN_QUOTES)
*quote_state = 0;
else if (ft_strchr(&s[1], '\'')) // if closed quotes
else if (ft_strchr(&s[1], '\''))
*quote_state = IN_QUOTES;
else
return (0);
@@ -169,7 +169,7 @@ static int quote_state_change(int *quote_state, const char *s)
{
if (*quote_state == IN_DQUOTES)
*quote_state = 0;
else if (ft_strchr(&s[1], '\"')) // if closed quotes
else if (ft_strchr(&s[1], '\"'))
*quote_state = IN_DQUOTES;
else
return (0);