fix: 'echo '> >> < * ? [ ] | ; [ ] || && ( ) & # $ <<'' stop segfault now

This commit is contained in:
Camille Chauvet
2023-03-30 16:06:34 +02:00
parent 41bbe2bc0b
commit f66ab7790e
4 changed files with 7 additions and 7 deletions

View File

@ -6,7 +6,7 @@
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/30 15:39:25 by cchauvet #+# #+# */
/* Updated: 2023/03/30 15:40:06 by cchauvet ### ########.fr */
/* Updated: 2023/03/30 15:52:10 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
@ -33,7 +33,7 @@ int ft_is_in_quote(const char *str, size_t n)
i++;
}
if (start == -1)
return ((str[i] == '\'') + (str[i] == '\"') * 2);
return (0);
if (str[start] == '\'')
return (1);
return (2);

View File

@ -6,7 +6,7 @@
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/02/14 14:46:40 by cchauvet #+# #+# */
/* Updated: 2023/03/29 18:52:32 by cchauvet ### ########.fr */
/* Updated: 2023/03/30 15:38:56 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */