diff options
Diffstat (limited to 'src/p_lblock_next.c')
-rw-r--r-- | src/p_lblock_next.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/p_lblock_next.c b/src/p_lblock_next.c index 8b755da..707acc0 100644 --- a/src/p_lblock_next.c +++ b/src/p_lblock_next.c @@ -113,13 +113,13 @@ static t_bool void p_subst_alias(char word[], t_msh *msh) { - char *ptr; + char value[ARG_MAX]; char tmp[255]; size_t locat[2]; + char *ptr; t_bool good; t_quote_mode mode; - (void)msh; mode = Q_NONE; ptr = word; ptr = p_skip_whitespace(ptr); @@ -157,7 +157,14 @@ void ft_strlcpy(tmp, word + locat[0], ((locat[1] - locat[0] < 253) ? (locat[1] - locat[0]) : (254)) + 1); - ft_printf("(%s)\n", tmp); + if (u_get_alias_value(value, tmp, ARG_MAX, msh) != 0) + return ; + (void)ft_memmove(word + (locat[0] + ft_strlen(value)), + word + locat[1], + ft_strlen(word + locat[1]) + 1 * sizeof(char)); + (void)ft_memmove(word + locat[0], + value, + ft_strlen(value) * sizeof(char)); } } |