From 59172914d2a6831474431c068eea9eca1e710499 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Thu, 3 Sep 2020 19:41:05 +0200 Subject: =?UTF-8?q?Pourquoi=20je=20suis=20n=C3=A9=20idiot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/p_args_next.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/p_args_next.c b/src/p_args_next.c index 36f6bf1..10ca37f 100644 --- a/src/p_args_next.c +++ b/src/p_args_next.c @@ -27,10 +27,9 @@ static size_t end++; if (word[end] == c && c == C_DQUOTE) { - if (word[end - 1] == C_BACKSLASH) + if (word[end - 1] == C_BACKSLASH && word[end - 2] != C_BACKSLASH) { - if (word[end - 2] != C_BACKSLASH) - end++; + end++; } } } @@ -57,7 +56,16 @@ static size_t else if (word[end] == C_SQUOTE || word[end] == C_DQUOTE) { while (word[end] != C_NULL && ft_iswhitespace(word[end]) == FALSE) - end = p_skip_delim_size(word, word[end], end); + { + if (word[end] == C_SQUOTE || word[end] == C_DQUOTE) + end = p_skip_delim_size(word, word[end], end); + else + { + while (word[end] != C_NULL && + ft_iswhitespace(word[end]) == FALSE) + end++; + } + } } return (end); } -- cgit v1.2.3