From 904a7c07b31267b2336b144336fc6ff54627f6d0 Mon Sep 17 00:00:00 2001 From: nass1pro Date: Tue, 16 Jun 2020 13:21:57 +0200 Subject: Update parse --- src/lexer/trim.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/lexer/trim.c') 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) -- cgit