aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-07-16 10:20:31 +0200
committerCharles <sircharlesaze@gmail.com>2020-07-16 10:20:31 +0200
commitb05db7c497f647c536ec1210be910793c6c7749f (patch)
tree7ffce9ec12acdcfe07cff00e1755cb8c98581987
parent125470cc6c6c3d8c1184c4c716e20af0d6350b29 (diff)
parent402a1c7b076f514a6c46a80e71179ddd9e48c7e4 (diff)
downloadminishell-b05db7c497f647c536ec1210be910793c6c7749f.tar.gz
minishell-b05db7c497f647c536ec1210be910793c6c7749f.tar.bz2
minishell-b05db7c497f647c536ec1210be910793c6c7749f.zip
Merge branch 'master' of https://github.com/HappyTramp/minishell
-rw-r--r--include/lexer.h2
-rw-r--r--src/lexer/lexer.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/include/lexer.h b/include/lexer.h
index c9e1b4b..ab2a448 100644
--- a/include/lexer.h
+++ b/include/lexer.h
@@ -6,7 +6,7 @@
/* By: nahaddac <nahaddac@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/06/19 10:51:26 by nahaddac #+# #+# */
-/* Updated: 2020/07/13 14:10:15 by nahaddac ### ########.fr */
+/* Updated: 2020/07/16 07:10:58 by nahaddac ### ########.fr */
/* */
/* ************************************************************************** */
diff --git a/src/lexer/lexer.c b/src/lexer/lexer.c
index 400c161..4640d5a 100644
--- a/src/lexer/lexer.c
+++ b/src/lexer/lexer.c
@@ -7,6 +7,8 @@ int len_is_not_sep(char *input)
i = -1;
while(input[++i])
{
+ if (input[i] == '\\')
+ i += 1;
if (lexer_sep(input[i]))
return(i);
if (input[i] == '\'' || input[i] == '"')
@@ -28,6 +30,8 @@ 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]))