diff options
Diffstat (limited to 'src/lexer')
| -rw-r--r-- | src/lexer/trim.c | 9 | ||||
| -rw-r--r-- | src/lexer/utils.c | 6 |
2 files changed, 5 insertions, 10 deletions
diff --git a/src/lexer/trim.c b/src/lexer/trim.c index 991cecc..24eb99f 100644 --- a/src/lexer/trim.c +++ b/src/lexer/trim.c @@ -6,7 +6,7 @@ /* By: nahaddac <nahaddac@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/07/16 08:18:36 by nahaddac #+# #+# */ -/* Updated: 2020/09/14 15:40:21 by nahaddac ### ########.fr */ +/* Updated: 2020/09/14 16:23:35 by nahaddac ### ########.fr */ /* */ /* ************************************************************************** */ @@ -43,12 +43,7 @@ int del_quote(char *str) { while (str[i++] != '\0') { - if (str[i] == '\\' && str[i + 1] == '\'') - { - i++; - break; - } - else if (str[i] == '\\') + if (str[i] == '\\') i += 2; if (str[i] == '\'') { diff --git a/src/lexer/utils.c b/src/lexer/utils.c index d440de4..b4846d6 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/14 11:38:18 by nahaddac ### ########.fr */ +/* Updated: 2020/09/14 15:16:35 by charles ### ########.fr */ /* */ /* ************************************************************************** */ @@ -97,8 +97,8 @@ int quote_len(char *input, int i) i++; while (input[i] != quote_type && input[i] != '\0') { - if(input[i] == '\\') - i+=2; + if (quote_type == '"' && input[i] == '\\') + i++; i++; } while (ft_isblank(input[i + 1])) |
