aboutsummaryrefslogtreecommitdiff
path: root/src/lexer
diff options
context:
space:
mode:
authornass1pro <nass1pro@gmail.com>2020-07-16 11:39:19 +0200
committernass1pro <nass1pro@gmail.com>2020-07-16 11:39:19 +0200
commitfa48f7393222175c6e62ed8c78f2be3f9d5904b3 (patch)
treef54833eaddd0928c037dafd6c9685ba10a21d39e /src/lexer
parentd35382262ea5de1ed6d02b6dd7d269367de4e353 (diff)
downloadminishell-fa48f7393222175c6e62ed8c78f2be3f9d5904b3.tar.gz
minishell-fa48f7393222175c6e62ed8c78f2be3f9d5904b3.tar.bz2
minishell-fa48f7393222175c6e62ed8c78f2be3f9d5904b3.zip
update len_is_not_sep in lexer.c for '\'
Diffstat (limited to 'src/lexer')
-rw-r--r--src/lexer/lexer.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/lexer/lexer.c b/src/lexer/lexer.c
index 73e722d..7bacb9f 100644
--- a/src/lexer/lexer.c
+++ b/src/lexer/lexer.c
@@ -6,7 +6,7 @@
/* By: nahaddac <nahaddac@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/07/16 08:18:25 by nahaddac #+# #+# */
-/* Updated: 2020/07/16 10:34:46 by nahaddac ### ########.fr */
+/* Updated: 2020/07/16 11:39:11 by nahaddac ### ########.fr */
/* */
/* ************************************************************************** */
@@ -20,7 +20,11 @@ int len_is_not_sep(char *input)
while(input[++i])
{
if (input[i] == '\\')
- i += 2;
+ {
+ i +=2;
+ if (input[i] == '\\')
+ i += len_is_not_sep(&input[i]);
+ }
if (lexer_sep(input[i]))
return(i);
if (input[i] == '\'' || input[i] == '"')
@@ -43,7 +47,9 @@ int check_input(char *input)
i = 0;
op = 1;
if (input[i] == '\\' && lexer_sep(input[i + 1]))
+ {
i += 2;
+ }
if (input[i] == '(' || input[i] == ')')
return (i + 1);
if (lexer_sep(input[i]))
@@ -167,6 +173,6 @@ t_ftlst *lexer(char *input)
return (NULL);
lst = NULL;
lst = create_token_list(input, &lst);
- lst = lexe_trim_out(lst);
+ //lst = lexe_trim_out(lst);
return (lst);
}