diff options
-rw-r--r-- | src/p_lblock_next.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/p_lblock_next.c b/src/p_lblock_next.c index 0a982a5..036d6b5 100644 --- a/src/p_lblock_next.c +++ b/src/p_lblock_next.c @@ -92,11 +92,35 @@ void } } +static char + *p_skip_whitespace(char *ptr) +{ + while (*ptr != C_NUL && ft_iswhitespace(*ptr)) + ptr++; + return (ptr); +} + void p_subst_alias(char word[], t_msh *msh) { - (void)word; + char *ptr; + size_t first; + t_quote_mode mode; + (void)msh; + mode = Q_NONE; + ptr = word; + p_skip_whitespace(ptr); + first = 1; + while (*ptr != C_NUL) + { + if (*ptr == C_DQUOTE) + mode = u_meet_dquote(word, ptr, mode); + if (*ptr == C_SQUOTE) + mode = u_meet_squote(word, ptr, mode); + if (ft_iswhitespace(*ptr) == TRUE && p_meet_whitespace((char*)word, ptr, mode) == TRUE) + ptr++; + } } char |