diff options
Diffstat (limited to 'src/p_args_escape.c')
-rw-r--r-- | src/p_args_escape.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/p_args_escape.c b/src/p_args_escape.c index ed319a1..abdf3b3 100644 --- a/src/p_args_escape.c +++ b/src/p_args_escape.c @@ -71,13 +71,12 @@ static t_quote_mode } static void - p_escape_bs(char *ptr, char **p, char word[], t_quote_mode mode) + p_escape_bs(char *ptr, char word[], t_quote_mode mode) { if (mode == Q_NONE) { (void)ft_memmove(word + (ptr - word), ptr + 1, (ft_strlen(ptr + 1) + 1) * sizeof(char)); - *(p) -= 1; } else if (mode == Q_DOUBLE) { @@ -85,13 +84,11 @@ static void { (void)ft_memmove(word + (ptr - word), ptr + 1, (ft_strlen(ptr + 1) + 1) * sizeof(char)); - *(p) -= 1; } else if (*(ptr + 1) == C_DQUOTE) { (void)ft_memmove(word + (ptr - word), ptr + 1, (ft_strlen(ptr + 1) + 1) * sizeof(char)); - *(p) -= 1; } } } @@ -108,10 +105,10 @@ static void { if (*ptr == C_SQUOTE) mode = p_escape_squote(ptr, &ptr, word, mode); - if (*ptr == C_DQUOTE) + else if (*ptr == C_DQUOTE) mode = p_escape_dquote(ptr, &ptr, word, mode); - if (*ptr == C_BACKS) - p_escape_bs(ptr, &ptr, word, mode); + else if (*ptr == C_BACKS) + p_escape_bs(ptr, word, mode); ptr++; } } |