diff options
| author | nass1pro <nass1pro@gmail.com> | 2020-09-10 08:33:48 +0200 |
|---|---|---|
| committer | nass1pro <nass1pro@gmail.com> | 2020-09-10 08:33:48 +0200 |
| commit | 10b54ed457ec0999e9289811401907d3a88970dc (patch) | |
| tree | 499a62144136f09c6aa3e1aa78785cd622743df0 | |
| parent | f8fba319d88a0d2475b5f55d5ef7aab071114a00 (diff) | |
| download | minishell-10b54ed457ec0999e9289811401907d3a88970dc.tar.gz minishell-10b54ed457ec0999e9289811401907d3a88970dc.tar.bz2 minishell-10b54ed457ec0999e9289811401907d3a88970dc.zip | |
test escape full ok
| -rw-r--r-- | src/lexer/lexer.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/lexer/lexer.c b/src/lexer/lexer.c index 57aee6b..befc9b8 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/09/10 06:40:10 by nahaddac ### ########.fr */ +/* Updated: 2020/09/10 08:33:29 by nahaddac ### ########.fr */ /* */ /* ************************************************************************** */ @@ -24,9 +24,14 @@ int len_until_sep(char *input) { i +=2; if (input[i] == '\\') - i += len_until_sep(&input[i]); - i += lexer_space(&input[i]); - if (input[i] != lexer_sep(input[i]) || input[i] != 39 || input[i] != '"') + ; + if (input[i] == ' ') + { + while(input[++i] == ' ') + ; + return i; + } + else if (input[i] != lexer_sep(input[i]) || input[i] != 39 || input[i] != '"') i += len_until_sep(&input[i]); return i; } |
