From 291cabef51915c280c26e567d864b6ea3fc56dbd Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Sat, 12 Sep 2020 06:32:26 +0200 Subject: In progress --- src/p_lblock_next.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'src') 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 -- cgit v1.2.3