summaryrefslogtreecommitdiffstats
path: root/src/p_args_escape.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/p_args_escape.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/p_args_escape.c b/src/p_args_escape.c
index 8a2e27f..ae96bb0 100644
--- a/src/p_args_escape.c
+++ b/src/p_args_escape.c
@@ -77,15 +77,16 @@ static void
{
(void)ft_memmove(word + (ptr - word), ptr + 1,
(ft_strlen(ptr + 1) + 1) * sizeof(char));
- if (*ptr == C_BS)
+ if (*ptr == C_BACKS)
{
*(word + (ptr - word)) = 26;
+ ft_printf("%s\n", word);
}
*(p) -= 1;
}
else if (mode == Q_DOUBLE)
{
- if (*(ptr + 1) == C_BS)
+ if (*(ptr + 1) == C_BACKS)
{
(void)ft_memmove(word + (ptr - word), ptr + 1,
(ft_strlen(ptr + 1) + 1) * sizeof(char));
@@ -109,13 +110,13 @@ static void
ptr = word;
mode = Q_NONE;
- while (*ptr != C_NULL)
+ while (*ptr != C_NUL)
{
if (*ptr == C_SQUOTE)
mode = p_escape_squote(ptr, &ptr, word, mode);
else if (*ptr == C_DQUOTE)
mode = p_escape_dquote(ptr, &ptr, word, mode);
- if (*ptr == C_BS)
+ if (*ptr == C_BACKS)
p_escape_bs(ptr, &ptr, word, mode);
ptr++;
}
@@ -124,10 +125,10 @@ static void
static void
p_replace_bs(char *ptr)
{
- while (*ptr != C_NULL)
+ while (*ptr != C_NUL)
{
if (*ptr == 26)
- *ptr = C_BS;
+ *ptr = C_BACKS;
ptr++;
}
}