diff options
Diffstat (limited to 'src/lexer/trim.c')
| -rw-r--r-- | src/lexer/trim.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lexer/trim.c b/src/lexer/trim.c index a0c7dec..6c435d5 100644 --- a/src/lexer/trim.c +++ b/src/lexer/trim.c @@ -27,10 +27,14 @@ char *del_quote(char *str) int i; char *s; - i = 1; - while(str[++i] != '\0') + i = 0; + while(str[i++] != '\0') + { + if(str[i] == '\\') + i+=2; if (str[i] == '\'' || str[i] == '"') break; + } s = ft_strsubf(str, 1, i - 1); return (s); } @@ -46,7 +50,6 @@ t_ftlst *lexe_trim_out(t_ftlst *lst) tk = lst->data; if (tk->tag & (TAG_STR_DOUBLE | TAG_STR_SINGLE)) { - //printf("%s\n",tk->content ); tk->content = del_quote(tk->content); if(lst->next == NULL) if (tk->tag & TAG_STICK) |
