diff options
Diffstat (limited to '')
-rw-r--r-- | src/p_args_escape.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/p_args_escape.c b/src/p_args_escape.c index ae96bb0..834d9f7 100644 --- a/src/p_args_escape.c +++ b/src/p_args_escape.c @@ -77,11 +77,6 @@ static void { (void)ft_memmove(word + (ptr - word), ptr + 1, (ft_strlen(ptr + 1) + 1) * sizeof(char)); - if (*ptr == C_BACKS) - { - *(word + (ptr - word)) = 26; - ft_printf("%s\n", word); - } *(p) -= 1; } else if (mode == Q_DOUBLE) @@ -90,7 +85,6 @@ static void { (void)ft_memmove(word + (ptr - word), ptr + 1, (ft_strlen(ptr + 1) + 1) * sizeof(char)); - *(word + (ptr - word)) = 26; *(p) -= 1; } else if (*(ptr + 1) == C_DQUOTE) @@ -125,10 +119,17 @@ static void static void p_replace_bs(char *ptr) { + char *head; + + head = ptr; while (*ptr != C_NUL) { - if (*ptr == 26) + if (*ptr == C_SUB && *(ptr + 1) == C_SUB) + { + (void)ft_memmove(head + (ptr - head), ptr + 1, + (ft_strlen(ptr + 1) + 1) * sizeof(char)); *ptr = C_BACKS; + } ptr++; } } |