diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-03 19:41:05 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-03 19:41:05 +0200 |
commit | 59172914d2a6831474431c068eea9eca1e710499 (patch) | |
tree | 7fa9cb7942715fe7c3414d6a98ae99302c466acf /src/p_args_next.c | |
parent | On est sur un problème (diff) | |
download | 42-minishell-59172914d2a6831474431c068eea9eca1e710499.tar.gz 42-minishell-59172914d2a6831474431c068eea9eca1e710499.tar.bz2 42-minishell-59172914d2a6831474431c068eea9eca1e710499.tar.xz 42-minishell-59172914d2a6831474431c068eea9eca1e710499.tar.zst 42-minishell-59172914d2a6831474431c068eea9eca1e710499.zip |
Pourquoi je suis né idiot
Diffstat (limited to 'src/p_args_next.c')
-rw-r--r-- | src/p_args_next.c | 16 |
1 files 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); } |