diff options
Diffstat (limited to '')
-rw-r--r-- | src/ft_b_echo.c | 54 |
1 files changed, 29 insertions, 25 deletions
diff --git a/src/ft_b_echo.c b/src/ft_b_echo.c index b837cac..de5431f 100644 --- a/src/ft_b_echo.c +++ b/src/ft_b_echo.c @@ -56,30 +56,26 @@ char return (str); } -void - ft_e_fill(char *ptr[], char **str) -{ - char *bs; - - ft_sprintf(*str, "%s", *ptr); - ptr++; - while (*ptr) - { - ft_sprintf(*str + ft_strlen(*str), " %s", *ptr); - ptr++; - } - if (*str[0] == '\"' || *str[0] == '\'') - { - *str = ft_strtrim(*str, "\"\'"); - ft_printf("%s", *str); - } - else if ((bs = ft_strrchr(*str, '\\'))) - { - ft_e_put(*str, 0); - } - else - ft_printf("%s", *str); -} +/***********************************************/ +/* void */ +/* ft_e_fill(char *ptr[], char **str) */ +/* { */ +/* char *bs; */ +/* */ +/* ft_sprintf(*str, "%s", *ptr); */ +/* if (*str[0] == '\"' || *str[0] == '\'') */ +/* { */ +/* *str = ft_strtrim(*str, "\"\'"); */ +/* ft_printf("%s", *str); */ +/* } */ +/* else if ((bs = ft_strrchr(*str, '\\'))) */ +/* { */ +/* ft_e_put(*str, 0); */ +/* } */ +/* else */ +/* ft_printf("%s", *str); */ +/* } */ +/***********************************************/ uint8_t ft_b_echo(char *args[], @@ -103,7 +99,15 @@ uint8_t ptr += 1; } if (argc - nopt >= 1) - ft_e_fill(ptr, &str); + { + ft_printf("%s", *ptr); + ptr++; + while (*ptr) + { + ft_printf(" %s", *ptr); + ptr++; + } + } } free(str); if (nopt == 0) |