summaryrefslogtreecommitdiffstats
path: root/src/ft_p_lcom_next.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ft_p_lcom_next.c')
-rw-r--r--src/ft_p_lcom_next.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/ft_p_lcom_next.c b/src/ft_p_lcom_next.c
index 07fadbe..8313b08 100644
--- a/src/ft_p_lcom_next.c
+++ b/src/ft_p_lcom_next.c
@@ -29,7 +29,8 @@ static int8_t
varval = NULL;
s_varname = NULL;
varlen = i + 1;
- while ((*p_words)[varlen] != '\0' && (*p_words)[varlen] != '$')
+ while ((*p_words)[varlen] != '\0' &&
+ !ft_ischarset("$=/#@%^*+{}[],.?-", (*p_words)[varlen]))
varlen += 1;
if (!(s_varname = ft_substr(*p_words, (uint32_t)i, varlen - i)))
return (-1);
@@ -48,12 +49,16 @@ char
int64_t i;
p_words = words;
+ i = 0;
while (*p_words)
{
- while ((i = ft_strlchr(*p_words, '$')) != -1)
+ while ((i = ft_strlchr((*p_words), '$')) != -1)
{
- if (ft_subst_those_vars(i, p_words, msh) != 0)
- return (NULL);
+ if (*(*p_words) + i - 1 != '\\')
+ {
+ if (ft_subst_those_vars(i, p_words, msh) != 0)
+ return (NULL);
+ }
}
p_words += 1;
}