aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--src/lexer/utils.c5
2 files changed, 6 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 0aabc5a..0e2168b 100644
--- a/Makefile
+++ b/Makefile
@@ -6,13 +6,13 @@
# By: cacharle <marvin@42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/02/03 04:14:24 by cacharle #+# #+# #
-# Updated: 2020/10/02 12:52:19 by cacharle ### ########.fr #
+# Updated: 2020/10/08 13:46:23 by cacharle ### ########.fr #
# #
# **************************************************************************** #
RM = rm -f
MAKE = make --no-print-directory
-JOBS = 4
+JOBS = 2
DOXYGEN = doxygen
DOXYGEN_FILE = Doxyfile
DOC_DIR = doc
diff --git a/src/lexer/utils.c b/src/lexer/utils.c
index 67319d9..d2b35cb 100644
--- a/src/lexer/utils.c
+++ b/src/lexer/utils.c
@@ -6,7 +6,7 @@
/* By: nahaddac <nahaddac@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/07/16 08:18:15 by nahaddac #+# #+# */
-/* Updated: 2020/09/17 13:27:44 by nahaddac ### ########.fr */
+/* Updated: 2020/10/08 14:10:17 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -55,12 +55,15 @@ enum e_tok tok_assign_stick(t_tok_lst *tok)
/*
** return tag si
** la chaine de character est un str où '' où ''
+** \note the loop after ft_strpbrk is to search again if the quote was escaped
*/
enum e_tok tok_assign_str(t_tok_lst *tok)
{
char *found;
found = ft_strpbrk(tok->content, "'\"");
+ while (found != NULL && found != tok->content && found[-1] == '\\')
+ found = ft_strpbrk(found + 1, "'\"");
if (found == NULL)
tok->tag = TAG_STR;
else if (*found == '\'')